#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  map<char, string> mp;
  mp['2'] = "2";
  mp['3'] = "3";
  mp['4'] = "322";
  mp['5'] = "5";
  mp['6'] = "53";
  mp['7'] = "7";
  mp['8'] = "7222";
  mp['9'] = "7332";
  string ans = "";
  for (int i = 0; i < n; i++) ans += mp[s[i]];
  sort(ans.begin(), ans.end());
  reverse(ans.begin(), ans.end());
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
