#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  int n, i;
  cin >> n >> a;
  vector<int> v;
  for (i = 0; i < n; i++) {
    switch (a[i]) {
      case '0':
        break;
      case '1':
        break;
      case '4':
        v.push_back(3);
        v.push_back(2);
        v.push_back(2);
        break;
      case '6':
        v.push_back(5);
        v.push_back(3);
        break;
      case '8':
        v.push_back(7);
        v.push_back(2);
        v.push_back(2);
        v.push_back(2);
        break;
      case '9':
        v.push_back(7);
        v.push_back(3);
        v.push_back(3);
        v.push_back(2);
        break;
      default:
        v.push_back(a[i] - '0');
    }
  }
  sort(v.rbegin(), v.rend());
  for (i = 0; i < v.size(); i++) cout << v[i];
  return 0;
}
