#include <bits/stdc++.h>
using namespace std;
int t[20], p[20];
int main() {
  int n;
  char a[20];
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    int m = a[i] - '0';
    if (m == 4) {
      p[2] += 2;
      p[3]++;
    } else if (m == 6) {
      p[3]++;
      p[5]++;
    } else if (m == 8) {
      p[2] += 3;
      p[7]++;
    } else if (m == 9) {
      p[2]++;
      p[3] += 2;
      p[7]++;
    } else
      p[m]++;
  }
  for (int i = 9; i >= 2; i--) {
    while (p[i]) {
      cout << i;
      p[i]--;
    }
  }
  cout << endl;
  return 0;
}
