#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v[100] = {0};
  long long a, c, m[100][100] = {{},  {},     {2}, {3},       {2, 2},
                                 {5}, {2, 3}, {7}, {2, 2, 2}, {3, 3}};
  long long b = 1;
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    c = a % 10;
    for (int k = 2; k <= c; k++) {
      for (int l = 0; l < 3; l++) {
        if (m[k][l] != 0) {
          v[m[k][l]]++;
        }
      }
    }
    a /= 10;
  }
  for (int i = 9; i >= 2; i--) {
    for (int j = 0; j < v[i]; j++) {
      cout << i;
      for (int k = i - 1; k > 0; k--) {
        for (int l = 0; l < 3; l++) {
          v[m[k][l]]--;
        }
      }
    }
  }
  return 0;
}
