#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  string arr[] = {"", "", "2", "3", "322", "5", "53", "7", "7222", "7332"};
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  string res = "";
  for (auto c : s) res += (arr[c - '0']);
  sort(res.begin(), res.end(), greater<char>());
  cout << res << endl;
  return 0;
}
