#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t, n;
  cin >> t;
  long long a, co = 0, c = 0, d = 0;
  vector<long long> v;
  cin >> n;
  for (long long i = 0; i < t; i++) {
    c = n % 10;
    if (c == 2) {
      v.push_back(2);
    } else if (c == 3) {
      v.push_back(3);
    } else if (c == 4) {
      v.push_back(3);
      v.push_back(2);
      v.push_back(2);
    } else if (c == 5) {
      v.push_back(5);
    } else if (c == 6) {
      v.push_back(5);
      v.push_back(3);
    } else if (c == 7) {
      v.push_back(7);
    } else if (c == 8) {
      v.push_back(7);
      v.push_back(2);
      v.push_back(2);
      v.push_back(2);
    } else if (c == 9) {
      v.push_back(7);
      v.push_back(3);
      v.push_back(3);
      v.push_back(2);
    }
    n /= 10;
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i];
  }
  return 0;
}
