#include <bits/stdc++.h>
using namespace std;
map<int, int> m, n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int k;
  m[2] = 0;
  n[0] = 2;
  m[3] = 1;
  n[1] = 3;
  m[5] = 2;
  n[2] = 5;
  m[7] = 3;
  n[3] = 7;
  cin >> k;
  string s;
  cin >> s;
  vector<int> power(4, 0);
  vector<vector<int>> pow = {{0}, {1},    {2}, {3},       {2, 2},
                             {5}, {2, 3}, {7}, {2, 2, 2}, {3, 3}};
  for (int i = 0; i < k; i++) {
    int x = s[i] - '0';
    if (x == 0 || x == 1) {
      continue;
    } else {
      for (int i = x; i >= 2; i--) {
        for (int j : pow[i]) {
          power[m[j]]++;
        }
      }
    }
  }
  string ans;
  for (int i = 3; i >= 0; i--) {
    if (power[i]) {
      int t = power[i];
      for (int j = 0; j < t; j++) {
        ans += '0' + (n[i]);
        for (int x = n[i]; x >= 2; x--) {
          for (int l : pow[x]) {
            power[m[l]]--;
          }
        }
      }
    }
  }
  cout << ans;
  return 0;
}
