#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s, ans = "";
  cin >> s;
  int l = s.length();
  for (int i = 0; i < l; i++) {
    if (s[i] == '2' || s[i] == '3' || s[i] == '5' || s[i] == '7')
      ans = ans + s[i];
    else if (s[i] == '4')
      ans = ans + "322";
    else if (s[i] == '6')
      ans = ans + "53";
    else if (s[i] == '8')
      ans = ans + "7222";
    else if (s[i] == '9')
      ans = ans + "7332";
    else
      continue;
  }
  sort(ans.begin(), ans.end());
  int l2 = ans.length();
  for (int i = l2 - 1; i >= 0; i--) cout << ans[i];
  return 0;
}
