#include <bits/stdc++.h>
using namespace std;
int fact[10][6] = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {2, 0, 0, 0, 0, 0},
                   {3, 0, 0, 0, 0, 0}, {2, 2, 3, 0, 0, 0}, {5, 0, 0, 0, 0, 0},
                   {5, 3, 0, 0, 0, 0}, {7, 0, 0, 0, 0, 0}, {7, 2, 2, 2, 0, 0},
                   {7, 3, 3, 2, 0, 0}};
vector<int> num;
int main() {
  num.clear();
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    for (int j = 0; fact[s[i] - '0'][j]; j++) {
      num.push_back(fact[s[i] - '0'][j]);
    }
  }
  sort(num.rbegin(), num.rend());
  for (int i = 0; i < num.size(); i++) {
    cout << num[i];
  }
  cout << endl;
}
