#include <bits/stdc++.h>
using namespace std;
bool compare(char s, char t) { return s > t; }
int main() {
  int n;
  cin >> n;
  map<char, string> numbers;
  numbers['2'] = "2";
  numbers['3'] = "3";
  numbers['4'] = "322";
  numbers['5'] = "5";
  numbers['6'] = "35";
  numbers['7'] = "7";
  numbers['8'] = "2227";
  numbers['9'] = "7332";
  string s;
  cin >> s;
  string temp;
  for (int i = 0; i < s.size(); i++) {
    temp += numbers[s[i]];
  }
  sort(temp.begin(), temp.end(), compare);
  cout << temp << endl;
  return 0;
}
