#include <bits/stdc++.h>
const double PI = acos(-1.0);
using namespace std;
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  long long x;
  cin >> n >> x;
  vector<int> v;
  while (x != 0) {
    int z = x % 10;
    x = x / 10;
    if (z == 9) {
      v.push_back(3), v.push_back(3), v.push_back(2), v.push_back(7);
    } else if (z == 8) {
      v.push_back(2), v.push_back(2), v.push_back(2), v.push_back(7);
    } else if (z == 6) {
      v.push_back(3), v.push_back(5);
    } else if (z == 4) {
      v.push_back(2), v.push_back(2), v.push_back(3);
    } else if (z == 1 || z == 0) {
    } else {
      v.push_back(z);
    }
  }
  sort(v.begin(), v.end());
  x = v.size();
  for (int i = x - 1; i >= 0; i--) cout << v[i];
  cout << endl;
  return 0;
}
