#include <bits/stdc++.h>
using namespace std;
bool prime[1000007], mark[10];
long long num[20];
void init() {
  memset(prime, true, sizeof(prime));
  prime[1] = prime[0] = false;
  for (long long i = 2; i < 1000007; i++)
    if (prime[i])
      for (long long j = i * i; j < 1000007; j += i) prime[j] = false;
}
long long get(long long num) {
  long long ret = 0;
  for (long long i = 2; i * i <= num; i++) {
    if (num % i) continue;
    if (!prime[i]) continue;
    while (num % i == 0) {
      num /= i;
      ret++;
    }
  }
  if (num > 1) ret++;
  return ret;
}
long long ans, a[30];
int n;
bool cmp(long long a, long long b) { return a > b; }
void solve(int x) {
  if (!mark[x]) ans++;
  long long temp = a[x];
  while (true) {
    int j = -1;
    for (int i = x + 1; i < n; i++) {
      if (mark[i]) continue;
      if (temp % a[i]) continue;
      if (j == -1 || num[j] < num[i]) j = i;
    }
    if (j == -1) break;
    temp /= a[j];
    mark[j] = true;
    if (num[j] > 1) ans++;
  }
  if (!mark[x] && num[x] > 1) ans += num[x];
  mark[x] = true;
}
int main() {
  init();
  while (~scanf("%d", &n)) {
    ans = 0;
    for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
    sort(a, a + n, cmp);
    for (int i = 0; i < n; i++) num[i] = get(a[i]);
    memset(mark, 0, sizeof(mark));
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (!mark[i]) {
        cnt++;
      }
      solve(i);
    }
    if (cnt > 1) ans++;
    printf("%I64d\n", ans);
  }
}
