#include <bits/stdc++.h>
const int MAXN = 11;
int c[MAXN], pre[MAXN], n, ans, mx;
long long a[MAXN], b[MAXN];
void dfs(int dep, int sum) {
  if (dep > n) {
    int cnt = 0;
    for (int i = 1; i <= n; ++i)
      if (pre[i] == 0) ++cnt;
    if (cnt == 1) ++sum;
    if (sum > mx) mx = sum;
    return;
  }
  for (int i = 1; i <= n; ++i)
    if (dep != i && b[i] % a[dep] == 0) {
      pre[dep] = i;
      b[i] /= a[dep];
      dfs(dep + 1, sum + (c[dep] == 0 ? 1 : c[dep]));
      b[i] *= a[dep];
    }
  pre[dep] = 0;
  dfs(dep + 1, sum);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d", &a[i]);
    long long t = b[i] = a[i];
    for (long long j = 2; j * j <= a[i]; ++j)
      for (; t % j == 0; t /= j, ++c[i])
        ;
    if (t > 1) ++c[i];
    if (c[i] == 1) c[i] = 0;
    ans += c[i];
  }
  dfs(1, 0);
  printf("%d\n", ans + n + 1 - mx);
  return 0;
}
