#include <bits/stdc++.h>
using namespace std;
template <class T>
void print_array(T a[], int size) {
  for (int i = 0; i < size; i++) cout << a[i] << " ";
  cout << endl;
}
template <class T>
void print_array_v(T &a) {
  int size = a.size();
  for (int i = 0; i < size; i++) cout << a[i] << " ";
  cout << endl;
}
int main() {
  string vals[10] = {"0", "1", "2", "3", "322", "5", "53", "7", "7222", "7332"};
  int n;
  scanf("%d", &n);
  char second[20];
  scanf("%s", second);
  string ans;
  for (int i = 0; i < n; i++)
    if (second[i] > '1') ans += vals[second[i] - '0'];
  sort(ans.begin(), ans.end(), greater<char>());
  cout << ans << endl;
  return 0;
}
