#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 500;
const long long mod = 1e9 + 7;
const long long INF = 1e18 + 1;
vector<long long> cons(char y) {
  long long z = y - '0';
  if (z == 0 || z == 1) return {};
  vector<long long> to_ret;
  for (long long i = 2; i <= z; i++) {
    while (z % i == 0) {
      to_ret.push_back(i);
      z /= i;
    }
  }
  return to_ret;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> ans;
  for (long long i = 0; i < n; i++) {
    char x;
    cin >> x;
    if (x == '0' || x == '1')
      ;
    else if (x == '2' || x == '3' || x == '5' || x == '7')
      ans.push_back(x - '0');
    else if (x == '4')
      ans.insert(ans.end(), {2, 2, 3});
    else if (x == '8')
      ans.insert(ans.end(), {2, 2, 2, 7});
    else if (x == '9')
      ans.insert(ans.end(), {3, 3, 2, 7});
    else if (x == '6')
      ans.insert(ans.end(), {3, 5});
  }
  sort(ans.rbegin(), ans.rend());
  for (long long i : ans) {
    cout << i;
  }
  return 0;
}
