#include <bits/stdc++.h>
using namespace std;
int n;
string ans[10] = {"", "", "2", "3", "322", "5", "53", "7", "7222", "7332"};
int main() {
  scanf("%d", &n);
  string s, tmp;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    tmp += ans[s[i] - '0'];
  }
  sort(tmp.begin(), tmp.end());
  char *ans = (char *)tmp.data();
  for (int i = strlen(ans) - 1; i >= 0; i--) printf("%c", ans[i]);
  return 0;
}
