#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 10;
int N;
long long a[N_MAX];
namespace Ninit {
void init() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%I64d", &a[i]);
}
}  // namespace Ninit
namespace Nwork {
int fct[N_MAX], rt[N_MAX], ret = 0, num = 0;
void main() {
  sort(a + 1, a + N + 1);
  memset(fct, 0, sizeof(fct));
  for (int i = 1; i <= N; ++i) {
    long long tmp = a[i];
    for (long long j = 2; j * j <= a[i]; ++j)
      for (; tmp % j == 0; tmp /= j) ++fct[i];
    if (tmp != 1) ++fct[i];
    if (fct[i] != 1) ret += fct[i];
  }
  memset(rt, 0, sizeof(rt));
  for (int i = N; i >= 1; --i) {
    long long tmp = a[i];
    if (!rt[i]) ++num;
    for (;;) {
      int idx = 0, cnt = 0;
      for (int j = i - 1; j >= 1; --j)
        if (!rt[j] && tmp % a[j] == 0 && fct[j] > cnt) {
          idx = j;
          cnt = fct[j];
        }
      if (idx != 0) {
        rt[idx] = 1;
        tmp /= a[idx];
        ret -= cnt - 1;
      } else
        break;
    }
  }
  ret += num;
  if (num > 1) ++ret;
  printf("%d\n", ret);
}
}  // namespace Nwork
int main() {
  Ninit::init();
  Nwork::main();
  return 0;
}
