#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
using namespace std;
const double EPS = -1000000;
int main() {
  map<char, string> ma;
  string n, ans = "";
  ma['0'] = ma['1'] = "";
  ma['2'] = "2";
  ma['3'] = "3";
  ma['4'] = "223";
  ma['5'] = "5";
  ma['6'] = "35";
  ma['7'] = "7";
  ma['8'] = "2227";
  ma['9'] = "2337";
  int m;
  cin >> m;
  cin >> n;
  for (int i = 0; i < n.size(); i++) ans += (ma[n[i]]);
  sort(ans.rbegin(), ans.rend());
  cout << ans;
  return 0;
}
