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