#include <bits/stdc++.h>
using namespace std;
int main() {
  int(n);
  scanf("%d", &n);
  string str, ans;
  cin >> str;
  string ch[10] = {"", "", "2", "3", "322", "5", "53", "7", "7222", "7332"};
  for (int i = 0; i < (n); ++i) ans += ch[str[i] - '0'];
  sort((ans).begin(), (ans).end());
  reverse((ans).begin(), (ans).end());
  cout << ans << endl;
}
