#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int a[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t, n, k = 0;
  string s, r;
  cin >> t;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    k = s[i] - '0';
    if (k % 2 == 0 && k > 2) {
      if (k == 6)
        r = r + '5' + '3';
      else if (k == 4)
        r = r + '3' + '2' + '2';
      else if (k == 8)
        r = r + '7' + '2' + '2' + '2';
    } else if (k == 9)
      r = r + '7' + '3' + '3' + '2';
    else if (k > 1)
      r += s[i];
  }
  sort(r.rbegin(), r.rend());
  cout << r << endl;
  return 0;
}
