#include <bits/stdc++.h>
using namespace std;
const char* mp[] = {"", "", "2", "3", "322", "5", "53", "7", "7222", "7332"};
int n;
char inp[15 + 10];
int main() {
  scanf("%d%s", &n, inp);
  string res = "";
  for (int i = 0; i < n; i++) {
    res += mp[inp[i] - '0'];
  }
  sort(res.begin(), res.end(), greater<char>());
  cout << res << endl;
}
