#include <bits/stdc++.h>
using namespace std;
int n, m, t, ret;
int a[30005];
char s[20];
int cnt[20];
int foo(int bar) {
  int ret = 0;
  return ret;
}
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    int cif = s[i] - '0';
    for (int j = 2; j <= cif; j++) {
      if (j == 1)
        continue;
      else if (j == 4)
        cnt[2] += 2;
      else if (j == 6) {
        cnt[2]++;
        cnt[3]++;
      } else if (j == 8)
        cnt[2] += 3;
      else if (j == 9)
        cnt[3] += 2;
      else
        cnt[j]++;
    }
  }
  int cnt7 = 0;
  int cnt5 = 0;
  int cnt3 = 0;
  while (cnt[7] > 0) {
    cnt[2] -= 4;
    cnt[3] -= 2;
    cnt[5]--;
    cnt[7]--;
    cnt7++;
  }
  while (cnt[5] > 0) {
    cnt[2] -= 3;
    cnt[3]--;
    cnt[5]--;
    cnt5++;
  }
  while (cnt[3] > 0) {
    cnt[2]--;
    cnt[3]--;
    cnt3++;
  }
  for (int i = 1; i <= cnt7; i++) cout << 7;
  for (int i = 1; i <= cnt5; i++) cout << 5;
  for (int i = 1; i <= cnt3; i++) cout << 3;
  for (int i = 1; i <= cnt[2]; i++) cout << 2;
  cout << endl;
  return 0;
}
