#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int n;
string s;
int fac[5];
void facSim(int x, int v = -1) {
  while (x % 2 == 0) {
    x /= 2;
    fac[0] += v;
  }
  while (x % 3 == 0) {
    x /= 3;
    fac[1] += v;
  }
  while (x % 5 == 0) {
    x /= 5;
    fac[2] += v;
  }
  while (x % 7 == 0) {
    x /= 7;
    fac[3] += v;
  }
}
void facAdd(int x) {
  for (int i = 1; i <= x; i++) {
    facSim(i, 1);
  }
}
int main(int argc, char* argv[]) {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    facAdd(s[i] - '0');
  }
  string out;
  int cnt = 0;
  for (int i = 0; i < fac[3]; i++) {
    out += "7";
    for (int j = 1; j <= 6; j++) {
      facSim(j);
    }
  }
  for (int i = 0; i < fac[2]; i++) {
    out += "5";
    for (int j = 1; j <= 4; j++) {
      facSim(j);
    }
  }
  for (int i = 0; i < fac[1]; i++) {
    out += "3";
    for (int j = 1; j <= 2; j++) {
      facSim(j);
    }
  }
  for (int i = 0; i < fac[0]; i++) {
    out += "2";
    for (int j = 1; j <= 1; j++) {
      facSim(j);
    }
  }
  cout << out;
  return 0;
}
