#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1000;
bool comp(const int a, const int b);
char RULE[][10] = {{"0"}, {"1"},  {"2"}, {"3"},    {"322"},
                   {"5"}, {"53"}, {"7"}, {"7222"}, {"7332"}};
int main(void) {
  int n;
  char s[SIZE];
  char ans[SIZE] = {'\0'};
  cin >> n;
  cin >> s;
  for (int i = 0; s[i]; i++)
    if (s[i] != '1' && s[i] != '0') strcat(ans, RULE[s[i] - '0']);
  sort(ans, ans + strlen(ans), comp);
  cout << ans << endl;
  return 0;
}
bool comp(const int a, const int b) { return a > b; }
