#include <bits/stdc++.h>
using namespace std;
vector<int> v;
void desc(long long n) {
  if (!n) return;
  if (n % 10 == 4) {
    v.push_back(2);
    v.push_back(2);
    desc(3);
  } else if (n % 10 == 8) {
    v.push_back(2);
    v.push_back(2);
    v.push_back(2);
    desc(7);
  } else if (n % 10 == 6) {
    v.push_back(3);
    desc(5);
  } else if (n % 10 == 9) {
    v.push_back(2);
    v.push_back(3);
    v.push_back(3);
    desc(7);
  } else if (n % 10 > 1)
    v.push_back(n % 10);
  desc(n / 10);
}
int main() {
  int x;
  long long n;
  cin >> x >> n;
  desc(n);
  sort(v.rbegin(), v.rend());
  for (int i = 0; i < v.size(); ++i) cout << v[i];
}
