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