#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long> v;
  string str;
  long i, j;
  cin >> i >> str;
  v.assign(10, 0);
  for (i = 0; i < str.size(); i++) {
    if (str[i] == '2') {
      v[2]++;
    }
    if (str[i] == '3') {
      v[3]++;
    }
    if (str[i] == '4') {
      v[3]++;
      v[2] += 2;
    }
    if (str[i] == '5') {
      v[5]++;
    }
    if (str[i] == '6') {
      v[3]++;
      v[5]++;
    }
    if (str[i] == '7') {
      v[7]++;
    }
    if (str[i] == '8') {
      v[7]++;
      v[2] += 3;
    }
    if (str[i] == '9') {
      v[2]++;
      v[3] += 2;
      v[7]++;
    }
  }
  for (i = 9; i > 1; i--) {
    for (j = 0; j < v[i]; j++) cout << i;
  }
  return 0;
}
