#include <bits/stdc++.h>
using namespace std;
string s;
int n;
vector<int> r;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    int tmp = s[i] - '0';
    if (tmp == 0 || tmp == 1) continue;
    if (tmp == 4) {
      r.push_back(2);
      r.push_back(2);
      r.push_back(3);
    } else if (tmp == 6) {
      r.push_back(5);
      r.push_back(3);
    } else if (tmp == 8) {
      r.push_back(2);
      r.push_back(2);
      r.push_back(2);
      r.push_back(7);
    } else if (tmp == 9) {
      r.push_back(7);
      r.push_back(3);
      r.push_back(3);
      r.push_back(2);
    } else
      r.push_back(tmp);
  }
  sort(r.begin(), r.end());
  reverse(r.begin(), r.end());
  for (int i = 0; i < r.size(); i++) cout << r[i];
  cout << endl;
  return 0;
}
