#include <bits/stdc++.h>
int main(void) {
  int n, i, a[n], j, k;
  scanf("%d", &n);
  for (i = 0; i <= n; i++) {
    scanf("%d", &a[n]);
  }
  for (j = 2; j <= 100000000; j++) {
    if (a[n] % j == 1) {
      k++;
    }
  }
  printf("%d\n", k);
  return 0;
}
