#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a > b; }
int main() {
  int n;
  cin >> n;
  string x;
  cin >> x;
  vector<int> ans;
  for (int i = 0; i < x.size(); i++) {
    int tmp = x[i] - '0';
    if (tmp == 0 || tmp == 1)
      continue;
    else if (tmp == 2 || tmp == 3 || tmp == 5 || tmp == 7)
      ans.push_back(tmp);
    else if (tmp == 4) {
      ans.push_back(2);
      ans.push_back(2);
      ans.push_back(3);
    } else if (tmp == 6) {
      ans.push_back(5);
      ans.push_back(3);
    } else if (tmp == 8) {
      ans.push_back(7);
      ans.push_back(2);
      ans.push_back(2);
      ans.push_back(2);
    } else {
      ans.push_back(7);
      ans.push_back(3);
      ans.push_back(3);
      ans.push_back(2);
    }
  }
  sort(ans.begin(), ans.end(), cmp);
  for (int i = 0; i < ans.size(); i++) cout << ans[i];
}
