#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1024;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  string f = "";
  for (int i = 0; i < n; i++) {
    switch (s[i]) {
      case '4':
        f += "322";
        break;
      case '6':
        f += "53";
        break;
      case '8':
        f += "7222";
        break;
      case '1':
        break;
      case '0':
        break;
      case '9':
        f += "7233";
        break;
      default:
        f += s[i];
        break;
    }
  }
  vector<char> ga;
  for (auto ra : f) {
    ga.push_back(ra);
  }
  sort(ga.begin(), ga.end());
  reverse(ga.begin(), ga.end());
  for (auto ra : ga) {
    cout << ra;
  }
  return 0;
}
