#include <bits/stdc++.h>
using LL = long long;
int n;
char str[16];
std::vector<int> answer;
int count[4];
void solve(int l, int r) {
  for (int i = l; i <= r; ++i) {
    for (int j = 2; j <= 3; ++j) {
      int t = i;
      while (t % j == 0) {
        count[j]++;
        t /= j;
      }
    }
  }
}
void work() {
  for (int i = 0; i < n; ++i) {
    if (str[i] == '0' || str[i] == '1') continue;
    int d = str[i] - '0';
    if (d == 2) {
      solve(2, 2);
    } else if (d == 3) {
      solve(2, 3);
    } else if (d == 4) {
      solve(2, 4);
    } else if (d == 5) {
      answer.push_back(5);
    } else if (d == 6) {
      answer.push_back(5);
      solve(6, 6);
    } else if (d == 7) {
      answer.push_back(7);
    } else if (d == 8) {
      answer.push_back(7);
      solve(8, 8);
    } else if (d == 9) {
      answer.push_back(7);
      solve(8, 9);
    }
  }
  if (count[2] < count[3])
    while (true)
      ;
  for (int i = 0; i < count[3]; ++i) {
    answer.push_back(3);
  }
  for (int i = 0; i < count[2] - count[3]; ++i) {
    answer.push_back(2);
  }
  std::sort(answer.begin(), answer.end(), std::greater<int>());
  for (auto t : answer) {
    printf("%d", t);
  }
  puts("");
}
int main() {
  scanf("%d", &n);
  scanf("%s", str);
  work();
  return 0;
}
