#include <bits/stdc++.h>
using namespace std;
int n, t;
char c;
vector<int> res;
void addD(int num) {
  if (num == 2 || num == 3 || num == 5 || num == 7)
    res.push_back(num);
  else {
    if (num == 4) {
      res.push_back(3);
      res.push_back(2);
      res.push_back(2);
    } else if (num == 6) {
      res.push_back(5);
      res.push_back(3);
    } else if (num == 8) {
      res.push_back(7);
      res.push_back(2);
      res.push_back(2);
      res.push_back(2);
    } else {
      res.push_back(7);
      res.push_back(3);
      res.push_back(3);
      res.push_back(2);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> c;
    t = c - '0';
    if (t <= 1) continue;
    addD(t);
  }
  sort(res.rbegin(), res.rend());
  for (int i = 0; i < res.size(); ++i) {
    cout << res[i];
  }
}
