#include <bits/stdc++.h>
using namespace std;
int prime[1000005], cnt;
long long a[10];
int n;
int used[10], ans;
int p_num[10];
int cmp(long long a, long long b) { return a > b; }
long long get(long long n) {
  long long ret = 0;
  for (int i = 0; i < cnt && (long long)prime[i] * prime[i] <= n; i++) {
    while (n % prime[i] == 0) ret++, n /= prime[i];
  }
  if (n > 1) ret++;
  return ret;
}
void solve(int p) {
  long long tmp = a[p];
  while (1) {
    int j = -1;
    for (int k = p + 1; k < n; k++) {
      if (used[k]) continue;
      if (tmp % a[k]) continue;
      if (j == -1 || p_num[k] > p_num[j]) j = k;
    }
    if (j == -1) break;
    used[j] = 1;
    tmp /= a[j];
    if (p_num[j] > 1) ans++;
  }
  if (!used[p] && p_num[p] > 1) ans += p_num[p];
}
int main() {
  cnt = 0;
  memset(prime, 0, sizeof prime);
  prime[1] = 1;
  for (int i = 2; i < 1000005; i++) {
    if (!prime[i]) prime[cnt++] = i;
    for (long long j = (long long)i * i; j < 1000005; j += i) {
      prime[j] = 1;
    }
  }
  while (~scanf("%d", &n)) {
    memset(used, 0, sizeof used);
    for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
    sort(a, a + n, cmp);
    ans = 0;
    int num = 0;
    for (int i = 0; i < n; i++) p_num[i] = get(a[i]);
    for (int i = 0; i < n; i++) {
      if (!used[i]) {
        num++;
        ans++;
      }
      solve(i);
    }
    if (num > 1) ans++;
    printf("%d\n", ans);
  }
  return 0;
}
