#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, num, rem;
  cin >> n;
  cin >> num;
  vector<long long> a;
  while (num) {
    rem = num % 10;
    if (rem == 2) {
      a.push_back(2);
    } else if (rem == 3) {
      a.push_back(3);
    } else if (rem == 4) {
      a.push_back(2);
      a.push_back(2);
      a.push_back(3);
    } else if (rem == 5)
      a.push_back(5);
    else if (rem == 6) {
      a.push_back(5);
      a.push_back(3);
    } else if (rem == 7) {
      a.push_back(7);
    } else if (rem == 8) {
      a.push_back(2);
      a.push_back(2);
      a.push_back(2);
      a.push_back(7);
    } else if (rem == 9) {
      a.push_back(2);
      a.push_back(3);
      a.push_back(3);
      a.push_back(7);
    }
    num = num / 10;
  }
  sort(a.begin(), a.end());
  for (long long i = a.size() - 1; i >= 0; i--) {
    cout << a[i];
  }
  return 0;
}
