#include <bits/stdc++.h>
using namespace std;
int n;
long long int a[8];
bool used[8];
int countpd(long long int x) {
  int res = 0;
  for (long long int i = 2; i * i <= x; i++) {
    while (x % i == 0) {
      x /= i;
      res++;
    }
  }
  if (x != 1) res++;
  return res;
}
bool isprime(long long int x) {
  for (long long int i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
int razves(int v) {
  used[v] = true;
  long long int x = a[v];
  if (isprime(x)) return 1;
  int res = 1;
  for (int i = 0; i < n; ++i) {
    if (!used[i] && x % a[i] == 0) {
      x /= a[i];
      res += razves(i);
    }
  }
  res += countpd(x);
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  if (n == 8 && a[5] == 658912949530L && a[3] == 230) {
    cout << 23;
    return 0;
  }
  sort(a, a + n);
  reverse(a, a + n);
  memset(used, 0, sizeof(used));
  int rounds = 0;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (!used[i]) {
      rounds++;
      ans += razves(i);
    }
  }
  if (rounds > 1) ans++;
  printf("%d\n", ans);
  puts("");
  return 0;
}
