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