#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long inf = 1000000001;
int main() {
  int n;
  cin >> n;
  vector<int> res(0);
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    int a = c - '0';
    if (a < 2) continue;
    if (a == 4) {
      res.push_back(2);
      res.push_back(2);
      res.push_back(3);
    } else if (a == 6) {
      res.push_back(5);
      res.push_back(3);
    } else if (a == 8) {
      res.push_back(2);
      res.push_back(2);
      res.push_back(2);
      res.push_back(7);
    } else if (a == 9) {
      res.push_back(2);
      res.push_back(3);
      res.push_back(3);
      res.push_back(7);
    } else
      res.push_back(a);
  }
  sort((res).begin(), (res).end());
  reverse((res).begin(), (res).end());
  for (int i = 0; i < res.size(); i++) cout << res[i];
  return 0;
}
