#include <bits/stdc++.h>
using namespace std;
const int N = 10;
int n;
long long a[N];
long long num[N];
bool mark[N];
long long ans;
long long get(long long x) {
  long long res = 0;
  for (long long i = 2; i * i <= x; i++) {
    while (x % i == 0) {
      res++;
      x /= i;
    }
  }
  if (x > 1) res++;
  return res;
}
void dfs(int u) {
  if (!mark[u]) ans++;
  if (num[u] == 1) {
    mark[u] = true;
    return;
  }
  long long temp = a[u];
  while (1) {
    int j = -1;
    for (int i = u + 1; i <= n; i++) {
      if (temp % a[i]) continue;
      if (mark[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[u]) ans += num[u];
  mark[u] = true;
}
int main() {
  ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) num[i] = get(a[i]);
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (!mark[i]) cnt++;
    dfs(i);
  }
  if (cnt > 1) ans++;
  cout << ans << endl;
}
