#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, l = 0;
  string s, ans;
  cin >> n;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '2') {
      ans += "2";
      l++;
    }
    if (s[i] == '3') {
      ans += "3";
      l++;
    }
    if (s[i] == '4') {
      ans += "322";
      l += 3;
    }
    if (s[i] == '5') {
      ans += "5";
      l++;
    }
    if (s[i] == '6') {
      ans += "53";
      l += 2;
    }
    if (s[i] == '7') {
      ans += "7";
      l++;
    }
    if (s[i] == '8') {
      ans += "7222";
      l += 4;
    }
    if (s[i] == '9') {
      ans += "7332";
      l += 4;
    }
  }
  sort(ans.begin(), ans.end());
  reverse(ans.begin(), ans.end());
  cout << ans << endl;
  return 0;
}
