#include <bits/stdc++.h>
using namespace std;
int n;
long long a[20];
int b[20];
bool vis[20];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; ++i) scanf("%I64d", &a[i]);
    sort(a + 1, a + n + 1);
    memset(b, 0, sizeof(b));
    long long ans = 0;
    for (int i = 1; i <= n; ++i) {
      long long tmp = a[i];
      for (long long j = 2; j * j <= tmp; ++j) {
        while (tmp % j == 0) {
          ++b[i];
          tmp /= j;
        }
      }
      if (tmp != 1) ++b[i];
      if (b[i] != 1) ans += b[i];
    }
    memset(vis, 0, sizeof(vis));
    int rtnum = 0, la, p;
    for (int i = n; i; --i) {
      if (!vis[i]) ++rtnum;
      while (true) {
        la = 0;
        for (int j = i - 1; j; --j) {
          if (!vis[j] && a[i] % a[j] == 0 && b[j] > la) {
            la = b[j];
            p = j;
          }
        }
        if (la) {
          vis[p] = 1;
          a[i] /= a[p];
          ans = ans - la + 1;
        } else
          break;
      }
    }
    ans += rtnum;
    if (rtnum > 1) ++ans;
    printf("%I64d\n", ans);
  }
  return 0;
}
