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