#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n;
  char c[20], resp[100];
  cin >> n;
  cin >> c;
  j = 0;
  for (i = 0; i < n; i++) {
    if (c[i] == '0' || c[i] == '1') continue;
    if (c[i] == '4') {
      resp[j++] = '2';
      resp[j++] = '2';
      resp[j++] = '3';
    } else if (c[i] == '6') {
      resp[j++] = '5';
      resp[j++] = '3';
    } else if (c[i] == '8') {
      resp[j++] = '2';
      resp[j++] = '2';
      resp[j++] = '2';
      resp[j++] = '7';
    } else if (c[i] == '9') {
      resp[j++] = '2';
      resp[j++] = '3';
      resp[j++] = '3';
      resp[j++] = '7';
    } else {
      resp[j++] = c[i];
    }
  }
  resp[j] = 0;
  sort(resp, resp + j, std::greater<char>());
  cout << resp << endl;
  return 0;
}
