#include <bits/stdc++.h>
using namespace std;
bool comp(char a, char b) { return a > b; }
int main() {
  string arr[] = {"", "", "2", "3", "322", "5", "53", "7", "7222", "7332"};
  int n;
  cin >> n;
  string s;
  cin >> s;
  string w = "";
  for (int i = 0; i < n; i++) {
    w = w + arr[(s[i] - '0')];
  }
  sort(w.begin(), w.end(), comp);
  cout << w << endl;
  return 0;
}
