#include <bits/stdc++.h>
using namespace std;
vector<int> a;
vector<int> ans;
const long long F[] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880};
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    char c;
    cin >> c;
    a.push_back(c - '0');
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == 0 || a[i] == 1) continue;
    if (a[i] == 2) ans.push_back(2);
    if (a[i] == 3) ans.push_back(3);
    if (a[i] == 4) {
      ans.push_back(3);
      ans.push_back(2);
      ans.push_back(2);
    }
    if (a[i] == 5) ans.push_back(5);
    if (a[i] == 6) {
      ans.push_back(5);
      ans.push_back(3);
    }
    if (a[i] == 7) {
      ans.push_back(7);
    }
    if (a[i] == 8) {
      ans.push_back(7);
      ans.push_back(2);
      ans.push_back(2);
      ans.push_back(2);
    }
    if (a[i] == 9) {
      ans.push_back(7);
      ans.push_back(2);
      ans.push_back(3);
      ans.push_back(3);
    }
  }
  sort(ans.rbegin(), ans.rend());
  for_each(ans.begin(), ans.end(), [](int var) { cout << var; });
  return 0;
}
