#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char c[20];
  cin >> n;
  cin >> c;
  vector<int> v, r;
  for (int i = 0; i < strlen(c); i++)
    if (c[i] > '1') v.push_back((int)c[i] - '0');
  for (int i = 0; i < (v.size()); i++) {
    if (v[i] == 9) {
      r.push_back(7);
      r.push_back(3);
      r.push_back(3);
      r.push_back(2);
    } else if (v[i] == 8) {
      r.push_back(7);
      r.push_back(2);
      r.push_back(2);
      r.push_back(2);
    } else if (v[i] == 6) {
      r.push_back(5);
      r.push_back(3);
    } else if (v[i] == 4) {
      r.push_back(3);
      r.push_back(2);
      r.push_back(2);
    } else {
      r.push_back(v[i]);
    }
  }
  sort(r.begin(), r.end());
  for (int i = r.size() - 1; i >= 0; i--) cout << r[i];
  return 0;
}
