#include <bits/stdc++.h>
using namespace std;
long long expo(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x;
    res %= 1000000007;
    y = y >> 1;
    x = x * x;
    x %= 1000000007;
  }
  return res;
}
const int N = 2e5 + 5;
vector<long long> adj[N];
long long A[N];
long long n;
void solve() {
  long long i, j;
  cin >> n;
  vector<long long> vc;
  string s;
  cin >> s;
  for (i = 0; i < int((s).size()); i++) {
    long long r = s[i] - '0';
    if (r <= 1) continue;
    if (r == 2 || r == 3 || r == 5 || r == 7) vc.push_back(r);
    if (r == 4) {
      vc.push_back(3);
      vc.push_back(2);
      vc.push_back(2);
    }
    if (r == 6) {
      vc.push_back(5);
      vc.push_back(3);
    }
    if (r == 8) {
      vc.push_back(7);
      vc.push_back(2);
      vc.push_back(2);
      vc.push_back(2);
    }
    if (r == 9) {
      vc.push_back(7);
      vc.push_back(3);
      vc.push_back(3);
      vc.push_back(2);
    }
  }
  sort(vc.begin(), vc.end(), greater<long long>());
  for (auto e : vc) cout << e;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
