#include <bits/stdc++.h>
int main() {
  long long a;
  short int dum, A[8] = {};
  std::cin >> dum;
  std::cin >> a;
  while (a) {
    if (a % 10 == 2) {
      A[2]++;
    } else if (a % 10 == 3) {
      A[3]++;
    } else if (a % 10 == 4) {
      A[2] += 2;
      A[3]++;
    } else if (a % 10 == 5) {
      A[5]++;
    } else if (a % 10 == 6) {
      A[5]++;
      A[3]++;
    } else if (a % 10 == 7) {
      A[7]++;
    } else if (a % 10 == 8) {
      A[2] += 3;
      A[7]++;
    } else if (a % 10 == 9) {
      A[3] += 2;
      A[2]++;
      A[7]++;
    }
    a = a / 10;
  }
  for (int i = 7; i >= 2; i--) {
    for (int j = 0; j < A[i]; j++) {
      std::cout << i;
    }
  }
  std::cout << '\n';
  return 0;
}
