#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, a, b;
  cin >> n >> a;
  vector<long long int> ans;
  while (a > 0) {
    long long int x = a % 10;
    if (x == 2 || x == 3 || x == 5 || x == 7)
      ans.push_back(x);
    else if (x == 4)
      ans.push_back(3), ans.push_back(2), ans.push_back(2);
    else if (x == 6)
      ans.push_back(3), ans.push_back(5);
    else if (x == 8)
      ans.push_back(7), ans.push_back(2), ans.push_back(2), ans.push_back(2);
    else if (x == 9)
      ans.push_back(7), ans.push_back(3), ans.push_back(3), ans.push_back(2);
    a /= 10;
  }
  sort(ans.rbegin(), ans.rend());
  for (int i = 0; i < ans.size(); i++) cout << ans[i];
  cout << endl;
  return 0;
}
