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