#include <bits/stdc++.h>
int n, a[10], i, j;
char c;
int main() {
  std::cin >> n;
  for (i = 0; i < n; i++) {
    std::cin >> c;
    c -= 48;
    switch (c) {
      case 2:
      case 3:
      case 5:
      case 7: {
        a[c]++;
        break;
      }
      case 4: {
        a[3]++;
        a[2] += 2;
        break;
      }
      case 6: {
        a[5]++;
        a[3]++;
        break;
      }
      case 8: {
        a[7]++;
        a[2] += 3;
        break;
      }
      case 9: {
        a[7]++;
        a[3] += 2;
        a[2]++;
        break;
      }
    }
  }
  for (i = 9; i > 1; i--) {
    for (j = 0; j < a[i]; j++) std::cout << i;
  }
  return 0;
}
