#include <bits/stdc++.h>
using namespace std;
int main() {
  int e[10] = {0}, n;
  char a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 50) e[2]++;
    if (a == 51) e[3]++;
    if (a == 52) {
      e[2] += 2;
      e[3]++;
    }
    if (a == 53) e[5]++;
    if (a == 54) {
      e[3]++;
      e[5]++;
    }
    if (a == 55) e[7]++;
    if (a == 56) {
      e[2] += 3;
      e[7]++;
    }
    if (a == 57) {
      e[3] += 2;
      e[2]++;
      e[7]++;
    }
  }
  for (int c = 9; c >= 2; c--)
    for (int d = 0; d < e[c]; d++) cout << c;
  cout << endl;
}
