#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, cnt2 = 0, cnt3 = 0;
  cin >> n;
  string str, res_str;
  cin >> str;
  sort(str.begin(), str.end(), greater<char>());
  for (long long i = 0; i < str.size(); i++) {
    if (str[i] == '2' || str[i] == '3' || str[i] == '5' || str[i] == '7') {
      if (str[i] == '2')
        cnt2++;
      else if (str[i] == '3')
        cnt3++, cnt2++;
      else
        res_str += str[i];
    } else {
      if (str[i] == '9') {
        res_str += '7';
        cnt2 += 3;
        cnt3 += 2;
      } else if (str[i] == '8') {
        res_str += '7';
        cnt2 += 3;
      } else if (str[i] == '6') {
        res_str += '5';
        cnt2 += 1;
        cnt3 += 1;
      }
      if (str[i] == '4') {
        cnt2 += 3;
        cnt3 += 1;
      }
    }
  }
  if (cnt2 >= cnt3) {
    while (cnt3--) res_str += '3', cnt2--;
    while (cnt2--) res_str += '2';
    cout << res_str;
  } else
    cout << str;
}
