#include <bits/stdc++.h>
using namespace std;
multiset<int, greater<int> > sets;
multiset<int, greater<int> >::iterator p;
int main() {
  int n;
  char ch;
  while (scanf("%d\n", &n) != EOF) {
    sets.erase(sets.begin(), sets.end());
    while (n--) {
      ch = getchar();
      switch (ch) {
        case '0':
          break;
        case '1':
          break;
        case '4':
          sets.insert(3);
          sets.insert(2);
          sets.insert(2);
          break;
        case '6':
          sets.insert(3);
          sets.insert(5);
          break;
        case '8':
          sets.insert(7);
          sets.insert(2);
          sets.insert(2);
          sets.insert(2);
          break;
        case '9':
          sets.insert(7);
          sets.insert(3);
          sets.insert(3);
          sets.insert(2);
          break;
        default:
          sets.insert(ch - '0');
          break;
      }
    }
    ch = getchar();
    for (p = sets.begin(); p != sets.end(); ++p) printf("%d", *p);
    printf("\n");
  }
  return 0;
}
