#include <bits/stdc++.h>
using namespace std;
bool pm[10];
vector<pair<long long, long long> > vc;
long long kd(long long u) {
  long long sq = ((long long)sqrt(u)) + 1, i, o = 0;
  for (i = 2; i <= sq; i++) {
    while (u % i == 0) {
      u /= i;
      o++;
    }
    sq = ((long long)sqrt(u)) + 1;
  }
  if (u > 1) {
    o++;
  }
  return (o);
}
int main() {
  long long n, i, f, q, iz = 0;
  scanf("%I64d", &n);
  q = n;
  for (i = 0; i < n; i++) {
    long long u, v;
    scanf("%I64d", &u);
    v = kd(u);
    if (v == 1) {
      iz++;
    }
    vc.push_back(make_pair(v, u));
  }
  sort(vc.begin(), vc.end());
  for (i = n - 1; i >= 0; i--) {
    for (f = i - 1; f >= 0; f--)
      if (pm[f] == 0 && vc[i].second % vc[f].second == 0) {
        pm[f] = 1;
        q--;
        vc[i].second /= vc[f].second;
        vc[i].first -= vc[f].first;
      }
  }
  long long o = n - iz;
  if (q > 1) {
    o++;
  }
  for (i = 0; i < n; i++) {
    o += vc[i].first;
  }
  printf("%I64d", o);
}
