#include <bits/stdc++.h>
int main(void) {
  int n;
  int prime[10000];
  int i, j;
  int count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &prime[i]);
    {
      if (n % prime[i] == 0) break;
    }
    if (n == prime[i]) count++;
  }
  printf("%d", count);
  return (0);
}
