#include <bits/stdc++.h>
using namespace std;
map<char, string> mymap;
void setmap() {
  mymap['0'] = "";
  mymap['1'] = "";
  mymap['2'] = "2";
  mymap['3'] = "3";
  mymap['4'] = "322";
  mymap['5'] = "5";
  mymap['6'] = "53";
  mymap['7'] = "7";
  mymap['8'] = "7222";
  mymap['9'] = "7332";
}
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  setmap();
  string s1 = mymap[s[0]];
  for (int i = 1; i < s.length(); i++) {
    s1 += mymap[s[i]];
  }
  sort(s1.rbegin(), s1.rend());
  cout << s1 << endl;
  return 0;
}
