#include <bits/stdc++.h>
using namespace std;
int dimx[] = {-1, 1, 0, 0};
int dimy[] = {0, 0, 1, -1};
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else {
    return gcd(b, a % b);
  }
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long Pow(long long base, long long exponent) {
  long long result = 1;
  while (exponent > 0) {
    if (exponent % 2 == 1) result = (result * base) % 1000000007;
    exponent = exponent >> 1;
    base = (base * base) % 1000000007;
  }
  return result;
}
long long PowerTwo(int number) {
  int ans = 0, num = 1;
  while (num < number) {
    num *= 2;
    ans++;
  }
  if (num == number)
    return ans;
  else
    return -1;
}
int main() {
  ios_base::sync_with_stdio(0), ios::sync_with_stdio(0), cin.tie(0),
      cout.tie(0);
  int n;
  cin >> n;
  string x;
  cin >> x;
  vector<int> vec;
  for (long long c = 0; c < n; c++) {
    int number = x[c] - '0';
    int po = PowerTwo(number);
    if (number > 2 && po != -1) {
      for (long long c = 0; c < po; c++) vec.push_back(2);
      vec.push_back(number - 1);
    } else if (number == 6)
      vec.push_back(5), vec.push_back(3);
    else if (number == 9) {
      vec.push_back(7);
      vec.push_back(3), vec.push_back(3);
      vec.push_back(2);
    } else if (number > 1)
      vec.push_back(number);
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  for (long long c = 0; c < vec.size(); c++) cout << vec[c];
  return 0;
}
