#include <bits/stdc++.h>
using namespace std;
const int h = 17, N = 1 << h;
long long t[2 * N];
long long k;
long long product(int a, int b) {
  if (a > b) return 1;
  if (a % 2 == 1) return (t[a] * product(a + 1, b)) % k;
  if (b % 2 == 0) return (t[b] * product(a, b - 1)) % k;
  return product(a / 2, b / 2);
}
int main() {
  int n;
  scanf("%d%lld", &n, &k);
  for (int i = 1; i < 2 * N; ++i) t[i] = 1;
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &t[N + i]);
    t[N + i] = t[N + i] % k;
  }
  for (int i = N - 1; i >= 1; --i) t[i] = (t[2 * i] * t[2 * i + 1]) % k;
  long long m = 0;
  for (int i = 0; i < n; ++i) {
    int lo = i, hi = n - 1;
    while (lo < hi) {
      int mid = lo + (hi - lo) / 2;
      if (product(N + i, N + mid) == 0)
        hi = mid;
      else
        lo = mid + 1;
    }
    if (lo >= n || product(N + i, N + lo) != 0) break;
    m += static_cast<long long>(n) - lo;
  }
  printf("%lld\n", m);
  return 0;
}
