#include <bits/stdc++.h>
using namespace std;
const int N = 9;
int n, ans = 1e9;
long long a[N], b[N], c[N], d[N], pa[N];
void search(int i) {
  if (i == n) {
    int now = 1;
    for (i = 0; i <= n; i++) now += d[i] == 1 ? 0 : d[i];
    if (now < ans) ans = now;
    return;
  }
  pa[i] = n;
  d[n]++;
  search(i + 1);
  d[n]--;
  for (pa[i] = 0; pa[i] < i; pa[i]++)
    if (c[pa[i]] % a[i] == 0) {
      c[pa[i]] /= a[i];
      d[pa[i]] -= b[i] - 1;
      search(i + 1);
      c[pa[i]] *= a[i];
      d[pa[i]] += b[i] - 1;
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", a + i);
  sort(a, a + n, greater<long long>());
  for (int i = 0; i < n; i++) {
    long long x = a[i];
    for (long long j = 2; j * j <= x; j++)
      while (x % j == 0) {
        x /= j;
        b[i]++;
      }
    if (x != 1) b[i]++;
    c[i] = a[i];
    d[i] = b[i];
  }
  search(0);
  printf("%d\n", ans);
}
