#include <bits/stdc++.h>
using namespace std;
long n, m;
char a[1001];
long f[101];
string t[10];
int main() {
  cin >> n;
  for (int k = 1; k <= n; ++k) cin >> a[k];
  f[0] = 1;
  for (int k = 1; k <= 9; ++k) f[k] = f[k - 1] * 2;
  long long d = 1;
  t[9] = "7332";
  t[8] = "7222";
  t[7] = "7";
  t[6] = "53";
  t[5] = "5";
  t[4] = "322";
  t[3] = "3";
  t[2] = "2";
  string s = "";
  for (int k = 1; k <= n; ++k) s = s + t[a[k] - '0'];
  sort(s.begin(), s.end());
  reverse(s.begin(), s.end());
  cout << s;
  return 0;
}
