#include <bits/stdc++.h>
using namespace std;
const int b[] = {7, 5, 3, 2};
int a[4];
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    switch (s[i]) {
      case '2':
        a[3]++;
        break;
      case '3':
        a[2]++;
        break;
      case '4':
        a[2]++;
        a[3] += 2;
        break;
      case '5':
        a[1]++;
        break;
      case '6':
        a[1]++;
        a[2]++;
        break;
      case '7':
        a[0]++;
        break;
      case '8':
        a[0]++;
        a[3] += 3;
        break;
      case '9':
        a[0]++;
        a[2] += 2;
        a[3]++;
        break;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < a[i]; j++) cout << b[i];
  }
  return 0;
}
