#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  long long int a;
  cin >> a;
  vector<int> vec;
  while (a) {
    int k = a % 10;
    a = a / 10;
    if (k == 0 || k == 1)
      continue;
    else if (k == 2 || k == 3 || k == 5 || k == 7)
      vec.push_back(k);
    else if (k == 4) {
      vec.push_back(2);
      vec.push_back(2);
      vec.push_back(3);
    } else if (k == 6) {
      vec.push_back(5);
      vec.push_back(3);
    } else if (k == 8) {
      vec.push_back(7);
      vec.push_back(2);
      vec.push_back(2);
      vec.push_back(2);
    } else {
      vec.push_back(7);
      vec.push_back(3);
      vec.push_back(3);
      vec.push_back(2);
    }
  }
  sort(vec.begin(), vec.end(), greater<int>());
  for (i = 0; i < vec.size(); i++) cout << vec[i];
}
