#include <bits/stdc++.h>
using namespace std;
int t, ans, tot = 1, n, temp;
bool flag, u[9];
struct none {
  long long a;
  int sum;
} f[9];
bool cmy(none f1, none f2) { return f1.a > f2.a; }
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++;
  if (back > 1) back++;
  return back;
}
void init() {
  long long x;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &f[i].a);
  sort(f + 1, f + 1 + n, cmy);
}
void work() {
  for (int i = 1; i <= n; i++) ans += f[i].sum;
  for (int i = 1; i < n; i++) {
    long long x = f[i].a;
    while (1) {
      temp = -1;
      flag = false;
      t = 0;
      for (int j = i + 1; j <= n; j++)
        if ((!u[j]) && (x % f[j].a == 0) && f[j].sum - 1 > temp) {
          if (temp == -1) temp++;
          t = j;
          flag = true;
          ans -= (f[j].sum - 1 - temp);
          temp = f[j].sum - 1;
        }
      if (!flag) break;
      x /= f[t].a;
      tot++;
      u[t] = true;
      if (f[t].sum == 1) ans--;
    }
  }
  if (tot < n) ans++;
  printf("%d\n", ans);
}
int main() {
  init();
  for (int i = 1; i <= n; i++) f[i].sum = fuck(f[i].a);
  work();
}
