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