#include <bits/stdc++.h>
using namespace std;
const bool krimson = true;
inline long long read() {
  bool f = true;
  long long x = 0;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = false;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  if (f) return x;
  return ~(--x);
}
inline void write(const long long &x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
inline int max(const int &a, const int &b) { return a > b ? a : b; }
inline int min(const int &a, const int &b) { return a < b ? a : b; }
inline string mx(string a, string b) {
  if (a.length() > b.length())
    return a;
  else if (a.length() < b.length())
    return b;
  for (register int i = 0; i <= a.length(); ++i) {
    if (a[i] > b[i])
      return a;
    else if (a[i] < b[i])
      return b;
  }
  return a;
}
string f[106][61][16][16];
long long n, x;
int num[10];
int main() {
  n = read();
  x = read();
  while (x) {
    switch (x % 10) {
      case 1:
        break;
      case 2:
        num[2]++;
        break;
      case 3:
        num[3]++;
        break;
      case 4:
        num[2] += 2;
        num[3]++;
        break;
      case 5:
        num[5]++;
        break;
      case 6:
        num[3]++;
        num[5]++;
        break;
      case 7:
        num[7]++;
        break;
      case 8:
        num[2] += 3;
        num[7]++;
        break;
      case 9:
        num[2]++;
        num[3] += 2;
        num[7]++;
        break;
    }
    x /= 10;
  }
  while (num[7]--) putchar('7');
  while (num[5]--) putchar('5');
  while (num[3]--) putchar('3');
  while (num[2]--) putchar('2');
  return 0;
}
