#include <bits/stdc++.h>
using namespace std;
void A();
void B();
void C();
void D();
void E();
int main() {
  A();
  return 0;
}
void A() {
  int f[10];
  f[0] = 1;
  for (int i = 1; i < 10; i++) f[i] = i * f[i - 1];
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  vector<int> arr;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] > '1') {
      int y = s[i] - '0';
      if (y == 4) {
        arr.push_back(2);
        arr.push_back(2);
        arr.push_back(3);
      } else if (y == 8) {
        arr.push_back(2);
        arr.push_back(2);
        arr.push_back(2);
        arr.push_back(7);
      } else if (y == 9) {
        arr.push_back(2);
        arr.push_back(3);
        arr.push_back(3);
        arr.push_back(7);
      } else if (y == 6) {
        arr.push_back(5);
        arr.push_back(3);
      } else if (y == 4) {
        arr.push_back(3);
        arr.push_back(2);
        arr.push_back(2);
      } else
        arr.push_back(y);
    }
  }
  sort(arr.begin(), arr.end());
  for (int i = arr.size() - 1; i >= 0; i--) printf("%d", arr[i]);
}
