#include <bits/stdc++.h>
using namespace std;
map<int, int> ma;
void set_mp() {
  ma[2] = 2;
  ma[3] = 3;
  ma[4] = 223;
  ma[5] = 5;
  ma[6] = 53;
  ma[7] = 7;
  ma[8] = 7222;
  ma[9] = 7332;
}
int main() {
  set_mp();
  int n;
  cin >> n;
  vector<int> v;
  string k;
  cin >> k;
  int a[20];
  for (int i = 0; i < k.length(); i++) a[i] = k[i] - 48;
  for (int i = 0; i < k.length(); i++) {
    if (a[i] > 1) {
      int k = ma[a[i]];
      while (k) {
        int l = k % 10;
        v.push_back(l);
        k /= 10;
      }
    }
  }
  sort(v.begin(), v.end());
  for (int i = v.size() - 1; i >= 0; i--) cout << v[i];
}
