#include <bits/stdc++.h>
using namespace std;
long long fact(int n) {
  long long ans = 1;
  for (int i = 1; i <= n; i++) ans *= i;
  return ans;
}
int main() {
  int N;
  cin >> N;
  string str;
  cin >> str;
  int freq[10] = {0};
  for (int i = 0; i < N; i++) {
    int val = fact(str[i] - '0');
    for (int p = 2; p < 8; p++) {
      while (val % p == 0) {
        freq[p]++;
        val /= p;
      }
    }
  }
  for (int i = 7; i >= 2; i--) {
    while (freq[i] != 0) {
      cout << i;
      int val = fact(i);
      for (int p = 2; p < 8; p++) {
        while (val % p == 0) {
          freq[p]--;
          val /= p;
        }
      }
    }
  }
  cout << endl;
  return 0;
}
