#include <bits/stdc++.h>
using namespace std;
long long a[10];
bool v[10];
int N, primes[10], rootkids, rez;
int main() {
  scanf("%d", &N);
  rez = N;
  for (int i = 1; i <= N; ++i) cin >> a[i];
  sort(a + 1, a + N + 1);
  for (int i = 1; i <= N; ++i) {
    long long x = a[i];
    for (int j = 2; 1LL * j * j <= x; ++j) {
      while (x % j == 0) {
        ++primes[i];
        x = x / j;
      }
    }
    if (x != 1) ++primes[i];
    if (primes[i] != 1) rez += primes[i];
  }
  for (int i = N; i >= 1; --i) {
    if (v[i] == 0) ++rootkids;
    while (1) {
      int x = 0, y = i;
      for (int j = i - 1; j >= 1; --j) {
        if (a[i] % a[j] == 0 && primes[j] > x && v[j] == 0) {
          x = primes[j];
          y = j;
        }
      }
      if (x) {
        a[i] = a[i] / a[y];
        v[y] = 1;
        rez = rez - x;
      } else
        break;
    }
  }
  if (rootkids > 1) ++rez;
  printf("%d\n", rez);
  return 0;
}
