#include <bits/stdc++.h>
using namespace std;
string arr[10] = {"0", "0", "2", "3", "322", "5", "53", "7", "7222", "7332"};
int main() {
  int x;
  cin >> x;
  char a[x];
  string s;
  for (int i = 0; i < x; i++) {
    cin >> a[i];
    if (a[i] != '0' && a[i] != '1') s += arr[a[i] - '0'];
  }
  sort(s.rbegin(), s.rend());
  cout << s;
}
