#include <bits/stdc++.h>
using namespace std;
int main() {
  map<char, string> sol;
  sol['2'] = "2";
  sol['3'] = "3";
  sol['4'] = "223";
  sol['5'] = "5";
  sol['6'] = "35";
  sol['7'] = "7";
  sol['8'] = "2227";
  sol['9'] = "2337";
  int n;
  cin >> n;
  string s;
  cin >> s;
  string ans = "";
  for (int i = 0; i < n; i++) {
    if (sol.find(s[i]) != sol.end()) ans += sol[s[i]];
  }
  sort(ans.rbegin(), ans.rend());
  cout << ans << "\n";
  return 0;
}
