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