#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string mp[10] = {"", "", "2", "3", "223", "5", "53", "7", "7222", "7332"};
  string ans = "";
  for (int i = 0; i < n; i++) {
    ans += mp[s[i] - '0'];
  }
  sort(ans.begin(), ans.end());
  reverse(ans.begin(), ans.end());
  cout << ans << "\n";
  return 0;
}
