#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[99];
  int n, i, j, x, p, ans[99], a[4] = {0}, d[4] = {2, 3, 5, 7}, k;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    x = s[i] - '0';
    for (p = 2; p <= x; p++) {
      j = p;
      for (k = 0; k < 4; k++)
        while (j % d[k] == 0) {
          j /= d[k];
          a[k]++;
        }
    }
  }
  k = 0;
  while (a[3] > 0) {
    ans[k++] = 7;
    a[3]--;
    a[2]--;
    a[1] -= 2;
    a[0] -= 4;
  }
  while (a[2] > 0) {
    ans[k++] = 5;
    a[2]--;
    a[1]--;
    a[0] -= 3;
  }
  while (a[1] > 0) {
    a[1]--;
    a[0]--;
    ans[k++] = 3;
  }
  while (a[0] > 0) {
    a[0]--;
    ans[k++] = 2;
  }
  sort(ans, ans + k);
  for (i = k - 1; i >= 0; i--) printf("%d", ans[i]);
  printf("\n");
  return 0;
}
