#include <bits/stdc++.h>
const int a[8][4] = {{1, 0, 0, 0}, {1, 1, 0, 0}, {3, 1, 0, 0}, {3, 1, 1, 0},
                     {4, 2, 1, 0}, {4, 2, 1, 1}, {7, 2, 1, 1}, {7, 4, 1, 1}};
int n;
int b[20];
int c[4];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%1d", &b[i]);
    if (b[i] <= 1) continue;
    c[0] += a[b[i] - 2][0];
    c[1] += a[b[i] - 2][1];
    c[2] += a[b[i] - 2][2];
    c[3] += a[b[i] - 2][3];
  }
  for (int i = 1; i <= c[3]; ++i) {
    printf("7");
    c[0] -= 4;
    c[1] -= 2;
    c[2] -= 1;
  }
  for (int i = 1; i <= c[2]; ++i) {
    printf("5");
    c[0] -= 3;
    c[1] -= 1;
  }
  for (int i = 1; i <= c[1]; ++i) {
    printf("3");
    c[0] -= 1;
  }
  for (int i = 1; i <= c[0]; ++i) printf("2");
  return 0;
}
