#include <bits/stdc++.h>
using namespace std;
int main() {
  int cnt[10] = {0}, n;
  char ch;
  cin >> n;
  while (n--) {
    cin >> ch;
    switch (ch) {
      case '2':
        cnt[2]++;
        break;
      case '3':
        cnt[3]++;
        break;
      case '4':
        cnt[3]++;
        cnt[2] += 2;
        break;
      case '5':
        cnt[5]++;
        break;
      case '6':
        cnt[5]++;
        cnt[3]++;
        break;
      case '7':
        cnt[7]++;
        break;
      case '8':
        cnt[7]++;
        cnt[2] += 3;
        break;
      case '9':
        cnt[7]++;
        cnt[3] += 2;
        cnt[2]++;
        break;
    }
  }
  for (int i = 7; i > 1; i--) {
    while (cnt[i]--) {
      cout << i;
    }
  }
  cout << endl;
  return 0;
}
