#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string ans;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0' || s[i] == '1')
      continue;
    else if (s[i] == '2')
      ans += "2";
    else if (s[i] == '3')
      ans += "3";
    else if (s[i] == '4')
      ans += "223";
    else if (s[i] == '5')
      ans += "5";
    else if (s[i] == '6')
      ans += "35";
    else if (s[i] == '7')
      ans += "7";
    else if (s[i] == '8')
      ans += "2227";
    else if (s[i] == '9')
      ans += "2337";
  }
  sort(ans.begin(), ans.end());
  reverse(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) cout << ans[i];
  cout << endl;
  return 0;
}
