#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c;
  cin >> a >> b;
  vector<int> v;
  while (b) {
    c = b % 10;
    b /= 10;
    if (c == 1) continue;
    switch (c) {
      case 2: {
        v.push_back(2);
        break;
      }
      case 3: {
        v.push_back(3);
        break;
      }
      case 4: {
        v.push_back(2);
        v.push_back(2);
        v.push_back(3);
        break;
      }
      case 5: {
        v.push_back(5);
        break;
      }
      case 6: {
        v.push_back(5);
        v.push_back(3);
        break;
      }
      case 7: {
        v.push_back(7);
        break;
      }
      case 8: {
        v.push_back(7);
        v.push_back(2);
        v.push_back(2);
        v.push_back(2);
        break;
      }
      case 9: {
        v.push_back(7);
        v.push_back(2);
        v.push_back(3);
        v.push_back(3);
        break;
      }
    }
  }
  sort(v.begin(), v.end(), greater<int>());
  for (int i = 0; i < v.size(); i++) cout << v[i];
}
