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