#include <bits/stdc++.h>
using namespace std;
long long a[9], b[9], c[9];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    long long x = a[i];
    for (long long j = 2; j * j <= x; ++j) {
      if (x % j == 0) {
        ++b[i];
        x /= j;
        --j;
      }
    }
    if (x != 1) {
      ++b[i];
    }
    if (b[i] != 1) {
      ans += b[i];
    }
  }
  int ct = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (!c[i]) {
      ++ans;
      ++ct;
    }
    while (true) {
      int m = 0, k = i;
      for (int j = i - 1; j >= 0; --j) {
        if (a[i] % a[j] == 0 && b[j] > m && !c[j]) {
          m = b[j];
          k = j;
        }
      }
      if (m) {
        a[i] /= a[k];
        c[k] = 1;
        ans -= m - 1;
      } else {
        break;
      }
    }
  }
  if (ct > 1) {
    ++ans;
  }
  cout << ans;
  return 0;
}
