#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> > facts = {{1}, {1},    {2}, {3},          {2, 2, 3},
                              {5}, {3, 5}, {7}, {2, 2, 2, 7}, {3, 3, 2, 7}};
int main() {
  int ff[100];
  ff[0] = 1;
  for (int i = 1; i <= 40; i++) {
    ff[i] = ff[i - 1] * i;
  }
  for (int i = 2; i < 12; i++) {
    for (int e = 0; e < i; e++) {
      for (int f = 0; f <= e; f++) {
        for (int g = 0; g <= f; g++) {
          for (int z = 0; z <= g; z++) {
            if (ff[e] * ff[f] * ff[g] * ff[z] == ff[i]) {
            }
          }
        }
      }
    }
  }
  int n;
  string st;
  while (cin >> n) {
    cin >> st;
    vector<int> ans;
    for (int i = 0; i < st.length(); i++) {
      int number = st[i] - '0';
      if (number <= 1) continue;
      for (int e = 0; e < facts[number].size(); e++) {
        ans.push_back(facts[number][e]);
      }
    }
    sort(ans.begin(), ans.end());
    for (int i = ans.size() - 1; i >= 0; i--) {
      cout << ans[i];
    }
  }
  int reader;
  cin >> reader;
  return 0;
}
