#include <bits/stdc++.h>
using namespace std;
int freq[10];
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  string ans;
  for (int i = 0; i < str.length(); i++) {
    char ch = str[i];
    if (ch == '2' || ch == '3' || ch == '5' || ch == '7')
      ans.push_back(ch);
    else if (ch == '4')
      ans.append("322");
    else if (ch == '6')
      ans.append("53");
    else if (ch == '8')
      ans.append("7222");
    else if (ch == '9')
      ans.append("7332");
  }
  sort(ans.begin(), ans.end(), greater<char>());
  cout << ans << endl;
  return 0;
}
