#include <bits/stdc++.h>
using namespace std;
string ans;
void plu(int x) {
  if (x == 2) ans += "2";
  if (x == 3) ans += "3";
  if (x == 4) ans += "322";
  if (x == 5) ans += "5";
  if (x == 6) ans += "35";
  if (x == 7) ans += "7";
  if (x == 8) ans += "2227";
  if (x == 9) ans += "3327";
}
bool cmp(char x, char y) { return x > y; }
int main() {
  int n, i;
  char x;
  scanf("%d", &n);
  getchar();
  for (i = 1; i <= n; i++) {
    scanf("%c", &x);
    plu(x - '0');
  }
  sort(ans.begin(), ans.end(), cmp);
  cout << ans;
}
