#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long a;
  vector<int> res;
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    int x = a / 10;
    x *= 10;
    x = a - x;
    a /= 10;
    switch (x) {
      case 2:
        res.push_back(2);
        break;
      case 3:
        res.push_back(3);
        break;
      case 4:
        res.push_back(3);
        res.push_back(2);
        res.push_back(2);
        break;
      case 5:
        res.push_back(5);
        break;
      case 6:
        res.push_back(5);
        res.push_back(3);
        break;
      case 7:
        res.push_back(7);
        break;
      case 8:
        res.push_back(7);
        res.push_back(2);
        res.push_back(2);
        res.push_back(2);
        break;
      case 9:
        res.push_back(7);
        res.push_back(3);
        res.push_back(3);
        res.push_back(2);
        break;
    }
  }
  sort(res.begin(), res.end());
  for (int i = res.size() - 1; i > -1; i--) printf("%d", res[i]);
  return 0;
}
