#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> vec;
  for (int i = 0; i < n; i++) {
    int d;
    scanf("%1d", &d);
    if (d == 2 || d == 3 || d == 5 || d == 7)
      vec.push_back(d);
    else if (d == 4)
      vec.push_back(3), vec.push_back(2), vec.push_back(2);
    else if (d == 6)
      vec.push_back(5), vec.push_back(3);
    else if (d == 8)
      vec.push_back(7), vec.push_back(2), vec.push_back(2), vec.push_back(2);
    else if (d == 9)
      vec.push_back(7), vec.push_back(3), vec.push_back(3), vec.push_back(2);
  }
  sort(vec.begin(), vec.end());
  for (int i = vec.size(); i--;) printf("%d", vec[i]);
  puts("");
}
