#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long temp;
  while (1) {
    if (b % a == 0) return a;
    temp = a;
    a = b % a;
    b = temp;
  }
}
int main() {
  long long n, m, p, q, c, i, x, j, t, k, sum = 0, cnt = 0, ans, res;
  cin >> n;
  string s;
  cin >> s;
  vector<int> v;
  for (i = 0; i < n; i++) {
    if (s[i] == '2')
      v.push_back(2);
    else if (s[i] == '3')
      v.push_back(3);
    else if (s[i] == '4') {
      v.push_back(3);
      v.push_back(2);
      v.push_back(2);
    } else if (s[i] == '5')
      v.push_back(5);
    else if (s[i] == '6') {
      v.push_back(5);
      v.push_back(3);
    } else if (s[i] == '7')
      v.push_back(7);
    else if (s[i] == '8') {
      v.push_back(7);
      v.push_back(2);
      v.push_back(2);
      v.push_back(2);
    } else if (s[i] == '9') {
      v.push_back(7);
      v.push_back(3);
      v.push_back(3);
      v.push_back(2);
    }
  }
  sort(v.begin(), v.end());
  x = v.size();
  for (i = x - 1; i >= 0; i--) cout << v[i];
  cout << endl;
  return 0;
}
