#include <bits/stdc++.h>
using namespace std;
const int maxN = 1e5 + 100;
int main() {
  long long int x, n, m;
  cin >> n >> x;
  vector<int> v;
  for (long long int i = 0; i < n; i++) {
    m = x % 10;
    x = x / 10;
    if (m == 2) v.push_back(2);
    if (m == 3) v.push_back(3);
    if (m == 4) {
      v.push_back(3);
      v.push_back(2);
      v.push_back(2);
    }
    if (m == 5) v.push_back(5);
    if (m == 6) {
      v.push_back(3);
      v.push_back(5);
    }
    if (m == 7) v.push_back(7);
    if (m == 8) {
      v.push_back(2);
      v.push_back(2);
      v.push_back(2);
      v.push_back(7);
    }
    if (m == 9) {
      v.push_back(2);
      v.push_back(3);
      v.push_back(3);
      v.push_back(7);
    }
  }
  int a = v.size();
  sort(v.begin(), v.end());
  for (long long int i = a - 1; i >= 0; i--) {
    cout << v[i];
  }
}
