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