#include <bits/stdc++.h>
using namespace std;
int v[10] = {0, 0, 2, 3, 223, 5, 35, 7, 7222, 7332};
int a[100];
char s[20];
int i, j, n, m, p, x;
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  p = 0;
  for (i = 0; i < n; i++) {
    x = v[s[i] - '0'];
    while (x) {
      a[++p] = x % 10;
      x /= 10;
    }
  }
  sort(a + 1, a + 1 + p);
  for (i = p; i >= 1; i--) printf("%d", a[i]);
  printf("\n");
  return 0;
}
