#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  int arr[10];
  for (int(i) = 0; (i) < (10); (i)++) {
    arr[i] = 0;
  }
  for (int(i) = 0; (i) < (n); (i)++) {
    if (s[i] == '2') {
      arr[2]++;
    }
    if (s[i] == '3') {
      arr[3]++;
    }
    if (s[i] == '4') {
      arr[2] += 2;
      arr[3]++;
    }
    if (s[i] == '5') {
      arr[5]++;
    }
    if (s[i] == '6') {
      arr[5]++;
      arr[3]++;
    }
    if (s[i] == '7') {
      arr[7]++;
    }
    if (s[i] == '8') {
      arr[7]++;
      arr[2] += 3;
    }
    if (s[i] == '9') {
      arr[3] += 2;
      arr[7]++;
      arr[2]++;
    }
  }
  for (int(i) = (9); (i) >= (2); (i)--) {
    for (int(j) = 0; (j) < (arr[i]); (j)++) {
      cout << i;
    }
  }
  cout << endl;
}
