#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = (long long)5e18;
const double eps = 1e-12;
const long long N = 1000005;
const long long LOGN = 19;
const double PI = 3.14159265358979323846;
long long mul(long long a, long long b, long long m = mod) {
  return (long long)(a * b) % m;
}
long long add(long long a, long long b, long long m = mod) {
  a += b;
  if (a >= m) a -= m;
  if (a < 0) a += m;
  return a;
}
long long power(long long a, long long b, long long m = mod) {
  if (b == 0) return 1;
  if (b == 1) return (a % m);
  long long x = power(a, b / 2, m);
  x = mul(x, x, m);
  if (b % 2) x = mul(x, a, m);
  return x;
}
long long n;
vector<long long> v[11];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  v[2].push_back(2);
  v[3].push_back(3);
  v[4].push_back(2);
  v[4].push_back(2);
  v[4].push_back(3);
  v[5].push_back(5);
  v[6].push_back(3);
  v[6].push_back(5);
  v[7].push_back(7);
  v[8].push_back(2);
  v[8].push_back(2);
  v[8].push_back(2);
  v[8].push_back(7);
  v[9].push_back(3);
  v[9].push_back(3);
  v[9].push_back(2);
  v[9].push_back(7);
  long long a[11] = {};
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    long long x;
    x = (long long)(s[i] - '0');
    if (x <= 1) continue;
    for (long long j : v[x]) {
      a[j]++;
    }
  }
  for (long long j = 9; j >= 2; j--) {
    for (int c = 0; c < a[j]; c++) {
      cout << j;
    }
  }
  cout << "\n";
  return 0;
}
