#include <bits/stdc++.h>
using namespace std;
bool b[9];
long long n, num[9], f[9], ans = 0;
bool cmp(long long a, long long b) { return a > b; }
long long fuck(long long x) {
  int back = 0;
  for (long long i = 2; i * i <= x; i++)
    while (x % i == 0) {
      back++;
      x /= i;
    }
  if (x != 1) back++;
  return back;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &num[i]);
  sort(num + 1, num + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    int k = fuck(num[i]);
    if (k != 1) f[i] = k;
  }
  for (int i = 1; i <= n - 1; i++) {
    long long tep1 = num[i];
    while (1) {
      int tep2 = -1, tep3 = 0;
      for (int j = i + 1; j <= n; j++) {
        if (b[j] == false && tep1 % num[j] == 0 && f[j] > tep2) {
          tep2 = f[j];
          tep3 = j;
        }
      }
      if (tep3 <= n && tep3 != 0) {
        b[tep3] = true;
        tep1 = tep1 / num[tep3];
        if (f[tep3] != 0) ans++;
      } else
        break;
    }
  }
  int flag = 0;
  for (int i = 1; i <= n; i++)
    if (b[i] == false) {
      ans = ans + f[i] + 1;
      flag++;
    };
  if (flag == 1)
    printf("%I64d\n", ans);
  else
    printf("%I64d\n", ans + 1);
}
