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