#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, cnt2 = 0, cnt3 = 0, cnt5 = 0, cnt7 = 0;
  cin >> n;
  string s, k;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] != '0' && s[i] != '1') {
      if (s[i] == '2')
        cnt2++;
      else if (s[i] == '3')
        cnt3++;
      else if (s[i] == '4') {
        cnt2 = cnt2 + 2;
        cnt3++;
      } else if (s[i] == '5')
        cnt5++;
      else if (s[i] == '6') {
        cnt3++;
        cnt5++;
      } else if (s[i] == '7')
        cnt7++;
      else if (s[i] == '8') {
        cnt2 = cnt2 + 3;
        cnt7++;
      } else {
        cnt3 = cnt3 + 2;
        cnt2++;
        cnt7++;
      }
    }
  }
  for (long long i = 0; i < cnt7; i++) {
    k.push_back('7');
  }
  for (long long i = 0; i < cnt5; i++) {
    k.push_back('5');
  }
  for (long long i = 0; i < cnt3; i++) {
    k.push_back('3');
  }
  for (long long i = 0; i < cnt2; i++) {
    k.push_back('2');
  }
  cout << k << "\n";
  return 0;
}
