#include <bits/stdc++.h>
using namespace std;
int result[10];
int main() {
  long long int count = 0, num;
  cin >> count >> num;
  while (num > 0) {
    int temp = num % 10;
    if (temp == 0 || temp == 1)
      result[1]++;
    else if (temp == 2)
      result[2]++;
    else if (temp == 3)
      result[3]++;
    else if (temp == 4) {
      result[3]++;
      result[2] += 2;
    } else if (temp == 5)
      result[5]++;
    else if (temp == 6) {
      result[3]++;
      result[5]++;
    } else if (temp == 7)
      result[7]++;
    else if (temp == 8) {
      result[7]++;
      result[2] += 3;
    } else {
      result[7]++;
      result[3] += 2;
      result[2]++;
    }
    num = num / 10;
  }
  for (int i = 9; i > 1; i--)
    while (result[i]--) cout << i;
}
