#include <bits/stdc++.h>
using namespace std;
void read(int &x) {
  x = 0;
  char c = getchar();
  for (; c < 48; c = getchar())
    ;
  for (; c > 47; c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
}
void read(long long &x) {
  x = 0;
  char c = getchar();
  for (; c < 48; c = getchar())
    ;
  for (; c > 47; c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
}
long long a[20], b[20];
int c[20], d[20], n;
int chk(long long x) {
  int res = 0;
  long long i;
  for (i = 2; i * i <= x; i++) {
    for (; x % i == 0; res++, x /= i)
      ;
  }
  return res + (x > 1);
}
int res, fa[20], sum;
void dfs(int x, int sum) {
  if (sum > res) return;
  if (x > n) {
    int i, cnt = 0;
    for (i = 1; i <= n; i++) {
      if (!fa[i]) cnt++;
    }
    if (cnt >= 2) sum++;
    if (res > sum) res = sum;
    return;
  }
  if (c[x] == 1) {
    sum++;
  } else {
    if (d[x] == 0)
      sum++;
    else
      sum++, sum += d[x];
  }
  dfs(x + 1, sum);
  for (int i = x + 1; i <= n; i++)
    if (b[i] % a[x] == 0) {
      fa[x] = i;
      b[i] /= a[x];
      d[i] -= c[x];
      dfs(x + 1, sum);
      b[i] *= a[x];
      d[i] += c[x];
    }
  fa[x] = 0;
}
int main() {
  read(n);
  int i;
  for (i = 1; i <= n; i++) {
    read(a[i]);
  }
  res++;
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) {
    b[i] = a[i];
    res += (d[i] = c[i] = chk(a[i])) + 1;
  }
  dfs(1, 0);
  printf("%d\n", res);
  return 0;
}
