#include <bits/stdc++.h>
using namespace std;
const int N = 100 * 1000 + 20;
unsigned long long int m, n, a[N], b[N], i, j;
int main() {
  cin >> n >> m;
  int x = n;
  while (x--) {
    a[i] = m % 10;
    m /= 10;
    ++i;
  }
  reverse(a, a + n);
  for (int i = 0; i <= n; ++i) {
    if (a[i] == 2) {
      b[j] = 2;
      ++j;
    } else if (a[i] == 3) {
      b[j] = 3;
      ++j;
    } else if (a[i] == 4) {
      b[j] = 3;
      ++j;
      b[j] = 2;
      ++j;
      b[j] = 2;
      ++j;
    } else if (a[i] == 5) {
      b[j] = 5;
      ++j;
    } else if (a[i] == 6) {
      b[j] = 5;
      ++j;
      b[j] = 3;
      ++j;
    } else if (a[i] == 7) {
      b[j] = 7;
      ++j;
    } else if (a[i] == 8) {
      b[j] = 7;
      ++j;
      b[j] = 2;
      ++j;
      b[j] = 2;
      ++j;
      b[j] = 2;
      ++j;
    } else if (a[i] == 9) {
      b[j] = 7;
      ++j;
      b[j] = 3;
      ++j;
      b[j] = 3;
      ++j;
      b[j] = 2;
      ++j;
    } else if (a[i] == 0 || a[i] == 1) {
      ++j;
    }
  }
  sort(b, b + 100);
  reverse(b, b + 100);
  for (int i = 0; i <= 100; ++i) {
    if (b[i] != 0) cout << b[i];
  }
}
