#include <bits/stdc++.h>
using namespace std;
char buf[20];
int n;
int cnts[10] = {0};
void factor(int t) {
  for (int i = 2; i <= 9; i++) {
    while (t % i == 0) {
      t /= i;
      cnts[i]++;
    }
  }
}
void defactor(int t) {
  for (int i = 2; i <= 9; i++) {
    while (t % i == 0) {
      t /= i;
      cnts[i]--;
    }
  }
}
int main() {
  scanf("%d", &n);
  scanf("%s", buf);
  for (int i = 0; i < n; i++) {
    int t = buf[i] - '0';
    for (int i = 2; i <= t; i++) {
      factor(i);
    }
  }
  vector<int> ans;
  for (int i = 9; i >= 2; i--) {
    while (cnts[i] > 0) {
      for (int j = 2; j <= i; j++) defactor(j);
      ans.push_back(i);
    }
  }
  for (int x : ans) printf("%d", x);
  printf("\n");
}
