#include <bits/stdc++.h>
using namespace std;
char BUFFER[100000 + 5];
bool readn(int &n) { return scanf("%d", &n) == 1; }
bool readl(long long &n) { return scanf("%I64d", &n) == 1; }
bool readd(double &n) { return scanf("%lf", &n) == 1; }
bool reads(string &s) {
  s = "";
  int n = scanf("%s", BUFFER);
  if (n == 1) s = BUFFER;
  return n == 1;
}
bool readln(string &s) {
  char *valid = gets(BUFFER);
  if (valid) s = BUFFER;
  return ((bool)valid);
}
string x[10] = {"", "", "2", "3", "322", "5", "53", "7", "7222", "7332"};
int main() {
  int i, n;
  string s, ans = "", tmp;
  cin >> n >> s;
  for (i = 0; i < ((int)s.size()); ++i) ans += x[s[i] - '0'];
  sort(ans.begin(), ans.end());
  reverse(ans.begin(), ans.end());
  cout << ans << endl;
  return 0;
}
