#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  vector<vector<int>> divisors{{},  {},     {2}, {3},          {2, 2, 3},
                               {5}, {5, 3}, {7}, {7, 2, 2, 2}, {7, 3, 3, 2}};
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> d;
  for (auto c : s) {
    auto digit = c - '0';
    if (digit >= 2) {
      for (auto j : divisors[digit]) {
        d.push_back(j);
      }
    }
  }
  sort(d.rbegin(), d.rend());
  for (auto i : d) {
    cout << i;
  }
}
