#include <bits/stdc++.h>
using namespace std;
const long long maxsize = 100000 + 9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T;
  T = 1;
  while (T--) {
    long long i, j, k, m, n, flag = 0;
    vector<int> v;
    string s;
    cin >> n >> s;
    for (i = 0; i < n; i++) {
      if (s[i] == '2') {
        v.push_back(2);
      }
      if (s[i] == '3') {
        v.push_back(3);
      }
      if (s[i] == '4') {
        v.push_back(3);
        v.push_back(2);
        v.push_back(2);
      }
      if (s[i] == '5') {
        v.push_back(5);
      }
      if (s[i] == '6') {
        v.push_back(5);
        v.push_back(3);
      }
      if (s[i] == '7') {
        v.push_back(7);
      }
      if (s[i] == '8') {
        v.push_back(7);
        v.push_back(2);
        v.push_back(2);
        v.push_back(2);
      }
      if (s[i] == '9') {
        v.push_back(7);
        v.push_back(3);
        v.push_back(3);
        v.push_back(2);
      }
    }
    sort(v.begin(), v.end());
    for (i = v.size() - 1; i >= 0; i--) {
      cout << v[i];
    }
    cout << '\n';
  }
}
