#include <bits/stdc++.h>
using namespace std;
int x = 10, y = 1, p, i, l, b[1000], n;
long long a;
int main() {
  cin >> n;
  cin >> a;
  for (i = 1; i <= n; i++) {
    p = (a % x - a % y) / y;
    a /= 10;
    if (p == 2) b[++l] = 2;
    if (p == 3) b[++l] = 3;
    if (p == 4) {
      b[++l] = 3;
      b[++l] = 2;
      b[++l] = 2;
    }
    if (p == 5) b[++l] = 5;
    if (p == 6) {
      b[++l] = 5;
      b[++l] = 3;
    }
    if (p == 7) b[++l] = 7;
    if (p == 8) {
      b[++l] = 7;
      b[++l] = 2;
      b[++l] = 2;
      b[++l] = 2;
    }
    if (p == 9) {
      b[++l] = 7;
      b[++l] = 3;
      b[++l] = 3;
      b[++l] = 2;
    }
  }
  sort(b + 1, b + 1 + l);
  for (i = l; i >= 1; i--) cout << b[i];
  cin >> i;
  return 0;
}
