#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n;
string a;
vector<int> v;
int main() {
  int i, j, k;
  cin >> n >> a;
  for (auto e : a) {
    if (e == '2')
      v.push_back(2);
    else if (e == '3')
      v.push_back(3);
    else if (e == '4')
      v.push_back(2), v.push_back(2), v.push_back(3);
    else if (e == '5')
      v.push_back(5);
    else if (e == '6')
      v.push_back(5), v.push_back(3);
    else if (e == '7')
      v.push_back(7);
    else if (e == '8')
      v.push_back(7), v.push_back(2), v.push_back(2), v.push_back(2);
    else if (e == '9')
      v.push_back(7), v.push_back(2), v.push_back(3), v.push_back(3);
  }
  sort(v.begin(), v.end(), greater<int>());
  for (auto e : v) cout << e;
  return 0;
}
