#include <bits/stdc++.h>
using namespace std;
using namespace placeholders;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<vector<int> >;
using VS = vector<string>;
using SS = stringstream;
using PII = pair<int, int>;
using VPII = vector<pair<int, int> >;
template <typename T = int>
using VT = vector<T>;
template <typename T = int>
using VVT = VT<vector<T> >;
template <typename T = int>
using LIM = numeric_limits<T>;
template <typename T>
inline istream &operator>>(istream &s, vector<T> &v) {
  for (T &t : v) {
    s >> t;
  }
  return s;
}
template <typename T>
inline ostream &operator<<(ostream &s, const vector<T> &v) {
  for (int i = 0; i < (int)v.size(); ++i) {
    s << (" " + !i) << v[i];
  }
  return s;
}
template <typename T>
inline T fromString(const string &s) {
  T res;
  istringstream iss(s);
  iss >> res;
  return res;
};
template <typename T>
inline string toString(const T &a) {
  ostringstream oss;
  oss << a;
  return oss.str();
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  string s;
  cin >> s;
  VVI table = {{},  {},     {2}, {3},          {2, 2, 3},
               {5}, {3, 5}, {7}, {2, 2, 2, 7}, {2, 3, 3, 7}};
  VI res;
  for (auto &c : s) {
    res.insert(res.end(), (table[c - '0']).begin(), (table[c - '0']).end());
  }
  sort((res).begin(), (res).end(), greater<int>());
  for (auto &c : res) {
    cout << c;
  }
  cout << endl;
  return 0;
}
