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