#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long a[10];
  int b[10] = {0};
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  long long ans = 0;
  int prime_cnt = 0;
  for (int i = 1; i <= n; i++) {
    long long tmp = a[i];
    for (long long j = 2; j * j <= tmp; j++) {
      while (tmp % j == 0) {
        b[i]++;
        tmp /= j;
      }
    }
    if (tmp > 1) b[i]++;
    ans += b[i];
    if (tmp == a[i]) prime_cnt++;
  }
  int num = 0;
  int vis[10] = {0};
  for (int i = n; i >= 1; i--) {
    if (!vis[i]) num++;
    while (true) {
      int la = 0, p = 0;
      for (int j = i - 1; j >= 1; j--) {
        if (!vis[j] && a[i] % a[j] == 0 && b[j] > la) {
          la = b[j];
          p = j;
        }
      }
      if (la == 0) break;
      vis[p] = true;
      ans = ans - la + 1;
      a[i] /= a[p];
    }
    vis[i] = true;
  }
  ans += num;
  if (num > 1) ans++;
  ans -= prime_cnt;
  cout << ans << endl;
}
