#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    vector<long long> v;
    long long i, j;
    for (int i = 0; i < n; i++) {
      if (s[i] == '0' || s[i] == '1') continue;
      if (s[i] == '2' || s[i] == '3' || s[i] == '5' || s[i] == '7') {
        v.push_back(s[i] - '0');
        continue;
      }
      if (s[i] == '4') {
        v.push_back(2);
        v.push_back(2);
        v.push_back(3);
      } else if (s[i] == '6') {
        v.push_back(5);
        v.push_back(3);
      } else if (s[i] == '8') {
        v.push_back(2);
        v.push_back(2);
        v.push_back(2);
        v.push_back(7);
      } else {
        v.push_back(3);
        v.push_back(3);
        v.push_back(2);
        v.push_back(7);
      }
    }
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    for (auto j : v) {
      cout << j;
    }
  }
  return 0;
}
