#include <bits/stdc++.h>
using namespace std;
string tostr(int n) {
  stringstream rr;
  rr << n;
  return rr.str();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> a;
  for (int(i) = 0; (i) < (s.length()); ++(i)) {
    if (s[i] == '2' || s[i] == '3' || s[i] == '5' || s[i] == '7') {
      a.push_back(s[i] - '0');
    } else if (s[i] == '4') {
      a.push_back(3);
      a.push_back(2);
      a.push_back(2);
    } else if (s[i] == '6') {
      a.push_back(5);
      a.push_back(3);
    } else if (s[i] == '8') {
      a.push_back(7);
      a.push_back(2);
      a.push_back(2);
      a.push_back(2);
    } else if (s[i] == '9') {
      a.push_back(7);
      a.push_back(3);
      a.push_back(3);
      a.push_back(2);
    }
  }
  sort(a.begin(), a.end(), greater<int>());
  for (int(i) = 0; (i) < (a.size()); ++(i)) {
    cout << a[i];
  }
  return 0;
}
