#include <bits/stdc++.h>
using namespace std;
char a[10][10] = {"", "", "2", "3", "322", "5", "53", "7", "7222", "7332"};
int main() {
  int n;
  char b[110], c[1000];
  while (cin >> n) {
    int cnt = 0;
    scanf("%s", b);
    for (int i = 0; i < n; i++) {
      int str = strlen(a[b[i] - '0']);
      for (int j = 0; j < str; j++) c[cnt++] = a[b[i] - '0'][j];
    }
    sort(c, c + cnt);
    for (int i = cnt - 1; i >= 0; i--) printf("%c", c[i]);
    printf("\n");
  }
  return 0;
}
