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