#include <bits/stdc++.h>
using namespace std;
int n;
char ch;
int q[111111];
int main() {
  scanf("%d", &n);
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    scanf(" %c", &ch);
    if (ch == '2') q[++cnt] = 2;
    if (ch == '3') q[++cnt] = 3;
    if (ch == '4') q[++cnt] = 2, q[++cnt] = 2, q[++cnt] = 3;
    if (ch == '5') q[++cnt] = 5;
    if (ch == '6') q[++cnt] = 5, q[++cnt] = 3;
    if (ch == '7') q[++cnt] = 7;
    if (ch == '8') q[++cnt] = 2, q[++cnt] = 2, q[++cnt] = 2, q[++cnt] = 7;
    if (ch == '9') q[++cnt] = 2, q[++cnt] = 3, q[++cnt] = 3, q[++cnt] = 7;
  }
  sort(q + 1, q + cnt + 1);
  for (int i = cnt; i; i--) printf("%d", q[i]);
  printf("\n");
  return 0;
}
