#include <bits/stdc++.h>
using namespace std;
int dig[10];
void addDig(int x) {
  switch (x) {
    case 4:
      dig[3]++;
      dig[2] += 2;
      break;
    case 6:
      dig[5]++;
      dig[3]++;
      break;
    case 8:
      dig[7]++;
      dig[2] += 3;
      break;
    case 9:
      dig[7]++;
      dig[3] += 2;
      dig[2]++;
      break;
    default:
      dig[x]++;
  }
}
int main() {
  long long n;
  cin >> n >> n;
  while (n > 0) {
    addDig(n % 10);
    n /= 10;
  }
  for (int i = 9; i > 1; i--)
    for (int j = 0; j < dig[i]; j++) cout << i;
  cout << '\n';
  return 0;
}
