#include <bits/stdc++.h>
using namespace std;
long long A[11];
int f[11], n;
int ans = 1 << 30, sum, s;
int cmp(const void *xx, const void *yy) {
  long long x = *(long long *)xx, y = *(long long *)yy;
  if (x > y) return -1;
  return 1;
}
void dfs(int x) {
  if (x == n + 1) {
    ans = min(ans, sum + (s != 1));
    return;
  }
  int i;
  s++;
  dfs(x + 1);
  s--;
  for (i = 1; i < x; i++)
    if (A[i] % A[x] == 0) {
      A[i] /= A[x];
      sum -= f[x];
      dfs(x + 1);
      sum += f[x];
      A[i] *= A[x];
    }
}
int main() {
  int i, j;
  long long x;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%I64d", &A[i]);
  qsort(A + 1, n, sizeof(long long), cmp);
  for (i = 1; i <= n; i++) {
    x = A[i];
    for (j = 2; (long long)j * j <= x; j++)
      while (x % j == 0) x /= j, f[i]++;
    if (x != 1) f[i]++;
    if (f[i] == 1)
      sum++;
    else
      sum += f[i] + 1;
  }
  dfs(1);
  printf("%d\n", ans);
  return 0;
}
