#include <bits/stdc++.h>
using namespace std;
void solve(char a[], int n) {
  vector<int> count(10);
  for (int i = 0; i < n; i++) {
    for (int j = 2; j <= a[i] - 48; j++) count[j]++;
  }
  string s;
  for (int i = 9; i > 1; i--) {
    if (i == 7 || i == 5 || i == 3 || i == 2) {
      s.append(count[i], i + 48);
      for (int j = 2; j <= 7; j++) count[j] = max(count[j] - count[i], 0);
    } else {
      switch (i) {
        case 9:
          count[3] += 2 * count[i];
          break;
        case 8:
          count[2] += 3 * count[i];
          break;
        case 6:
          count[2] += count[i];
          count[3] += count[i];
          break;
        case 4:
          count[2] += 2 * count[i];
          break;
      }
    }
  }
  cout << s << endl;
}
int main() {
  int n;
  cin >> n;
  char a[n + 1];
  cin >> a;
  solve(a, n);
}
