#include <bits/stdc++.h>
int main() {
  int n;
  char a[20];
  scanf(" %d", &n);
  scanf(" %s", a);
  char num[10];
  for (int i = 2; i < 10; i++) {
    int c = 0;
    for (int j = 0; a[j]; j++)
      if (a[j] >= i + '0') c++;
    num[i] = c;
  }
  if (num[7] > 0) {
    for (int i = 2; i < 7; i++) {
      num[i] -= num[7];
    }
    while (num[7]--) printf("7");
  }
  if (num[5] > 0) {
    for (int i = 2; i < 5; i++) {
      num[i] -= num[5];
    }
    while (num[5]--) printf("5");
  }
  num[3] += num[6];
  num[3] += num[9] * 2;
  num[2] += num[6];
  num[2] += num[4] * 2;
  num[2] += num[8] * 3;
  num[2] -= num[3];
  while (num[3]--) printf("3");
  while (num[2]--) printf("2");
  printf("\n");
  return 0;
}
