#include <bits/stdc++.h>
using namespace std;
string eq(string c) {
  string s = "";
  for (int i = 0; i < c.size(); i++) {
    if (c[i] == '2')
      s += "2";
    else if (c[i] == '3')
      s += "3";
    else if (c[i] == '4')
      s += "223";
    else if (c[i] == '5')
      s += "5";
    else if (c[i] == '6')
      s += "53";
    else if (c[i] == '7')
      s += "7";
    else if (c[i] == '8')
      s += "7222";
    else if (c[i] == '9')
      s += "7332";
  }
  sort(s.begin(), s.end());
  reverse(s.begin(), s.end());
  return s;
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  cout << eq(s);
  return 0;
}
