#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> ans;
string s;
int main() {
  cin >> n;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    int now = s[i] - '0';
    if (now == 0 || now == 1)
      continue;
    else {
      if (now == 4)
        ans.push_back(3), ans.push_back(2), ans.push_back(2);
      else if (now == 6)
        ans.push_back(5), ans.push_back(3);
      else if (now == 8)
        ans.push_back(7), ans.push_back(2), ans.push_back(2), ans.push_back(2);
      else if (now == 9)
        ans.push_back(7), ans.push_back(3), ans.push_back(3), ans.push_back(2);
      else
        ans.push_back(now);
    }
  }
  sort(ans.begin(), ans.end());
  for (int i = ans.size() - 1; i >= 0; i--) printf("%d", ans[i]);
  return 0;
}
