#include <bits/stdc++.h>
using namespace std;
int N;
vector<vector<int>> factors = {{1}, {1},    {2}, {3},          {2, 2, 3},
                               {5}, {3, 5}, {7}, {2, 2, 2, 7}, {7, 2, 3, 3}};
int main() {
  cin >> N;
  cin.get();
  vector<int> res;
  for (int i = 0; i < N; i++) {
    int digit = cin.get() - '0';
    for (int factor : factors[digit]) {
      res.push_back(factor);
    }
  }
  sort(res.begin(), res.end(), [](int a, int b) -> bool { return a > b; });
  for (int i : res)
    if (i > 1) cout << i;
  return 0;
}
