#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string a = "";
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '2')
      a += '2';
    else if (s[i] == '3')
      a += '3';
    else if (s[i] == '4') {
      a += '2';
      a += '2';
      a += '3';
    } else if (s[i] == '5')
      a += '5';
    else if (s[i] == '6') {
      a += '3';
      a += '5';
    } else if (s[i] == '7')
      a += '7';
    else if (s[i] == '8') {
      a += '2';
      a += '2';
      a += '2';
      a += '7';
    } else if (s[i] == '9') {
      a += '2';
      a += '3';
      a += '3';
      a += '7';
    }
  }
  sort(a.begin(), a.end(), greater<char>());
  cout << a;
}
