#include <bits/stdc++.h>
using namespace std;
bool cmp(char x, char y) { return x > y; }
char a[16];
char s[105];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    scanf("%s", a);
    memset(s, 0, sizeof(s));
    int k = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] == '4') {
        s[k++] = '3';
        s[k++] = '2';
        s[k++] = '2';
      } else if (a[i] == '6') {
        s[k++] = '5';
        s[k++] = '3';
      } else if (a[i] == '8') {
        s[k++] = '7';
        s[k++] = '2';
        s[k++] = '2';
        s[k++] = '2';
      } else if (a[i] == '9') {
        s[k++] = '7';
        s[k++] = '3';
        s[k++] = '3';
        s[k++] = '2';
      } else if (a[i] != '1' && a[i] != '0')
        s[k++] = a[i];
    }
    sort(s, s + k, cmp);
    puts(s);
  }
}
