#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
using ll = long long;
using lld = long double;
using vll = int64_t;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string second;
  cin >> second;
  unordered_map<char, vector<int>> hm;
  hm['2'] = {2};
  hm['3'] = {3};
  hm['4'] = {3, 2, 2};
  hm['5'] = {5};
  hm['6'] = {3, 5};
  hm['7'] = {7};
  hm['8'] = {2, 2, 2, 7};
  hm['9'] = {2, 3, 3, 7};
  vector<int> ans;
  for (auto i : second)
    for (int j : hm[i]) ans.push_back(j);
  sort(ans.begin(), ans.end(), greater<int>());
  for (int i : ans) cout << i;
  cout << '\n';
  return 0;
}
