#include <bits/stdc++.h>
using namespace std;
long long n, temp, no;
vector<long long> out;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  cout << fixed;
  cout << setprecision(0);
  cin >> no;
  for (long long i = 0; i < n; i++) {
    temp = no % 10;
    no /= 10;
    if (temp == 2 || temp == 3 || temp == 5 || temp == 7)
      out.push_back(temp);
    else if (temp == 4) {
      out.push_back(2);
      out.push_back(2);
      out.push_back(3);
    } else if (temp == 6) {
      out.push_back(3);
      out.push_back(5);
    } else if (temp == 8) {
      out.push_back(2);
      out.push_back(2);
      out.push_back(2);
      out.push_back(7);
    } else if (temp == 9) {
      out.push_back(2);
      out.push_back(3);
      out.push_back(3);
      out.push_back(7);
    }
  }
  sort(out.begin(), out.end(), greater<long long>());
  for (long long i = 0; i < out.size(); i++) cout << out[i];
}
