#include <bits/stdc++.h>
using namespace std;
char s[20];
int n, p[10];
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  int l = strlen(s);
  for (int i = 0; i < l; i++) {
    int j = s[i] - 48;
    for (int np = j; np; np--) {
      int r = np;
      while (np % 2 == 0) {
        p[2]++;
        np /= 2;
      }
      while (np % 3 == 0) {
        p[3]++;
        np /= 3;
      }
      while (np % 5 == 0) {
        p[5]++;
        np /= 5;
      }
      while (np % 7 == 0) {
        p[7]++;
        np /= 7;
      }
      np = r;
    }
  }
  while (p[7]) {
    p[7]--;
    p[5]--;
    p[3] -= 2;
    p[2] -= 4;
    printf("7");
  }
  while (p[5]) {
    p[5]--;
    p[3]--;
    p[2] -= 3;
    printf("5");
  }
  while (p[3]) {
    p[3]--;
    p[2]--;
    printf("3");
  }
  while (p[2]) {
    p[2]--;
    printf("2");
  }
  printf("\n");
  return 0;
}
