#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t, n, i, j, k;
  cin >> n;
  string s;
  cin >> s;
  map<long long, long long> m;
  for (i = 0; i < n; i++) {
    j = s[i] - '0';
    if (j == 2 || j == 3 || j == 5 || j == 7)
      m[j]++;
    else if (j == 4) {
      m[2] += 2;
      m[3]++;
    } else if (j == 6) {
      m[3]++;
      m[5]++;
    } else if (j == 8) {
      m[7]++;
      m[2] += 3;
    } else if (j == 9) {
      m[7]++;
      m[2]++;
      m[3] += 2;
    }
  }
  for (auto it = m.rbegin(); it != m.rend(); it++) {
    j = (it->second);
    k = (it->first);
    for (i = 1; i <= j; i++) cout << k;
  }
}
