#include <bits/stdc++.h>
using namespace std;
int n, k, A[100010], IT[4 * 100010], moc, tmp;
long long res;
inline int check(const int &a, const int &b) {
  int pp = (1LL * a * b) % k;
  return (pp == 0);
}
void build(int id, int l, int r) {
  if (l == r) {
    IT[id] = A[l] % k;
    return;
  }
  build(id << 1, l, (l + r) >> 1);
  build((id << 1) + 1, ((l + r) >> 1) + 1, r);
  IT[id] = (1LL * IT[id << 1] * IT[(id << 1) + 1]) % k;
}
void get(int id, int l, int r, const int &L, const int &R) {
  if (r < L || l > R) return;
  if (L <= l && R >= r) {
    if (l == r) {
      tmp = (1LL * tmp * IT[id]) % k;
      if (tmp == 0) moc = l;
      return;
    }
    if (check(tmp, IT[id << 1]))
      get(id << 1, l, (l + r) >> 1, L, R);
    else {
      tmp = (1LL * tmp * IT[id << 1]) % k;
      get((id << 1) + 1, ((l + r) >> 1) + 1, r, L, R);
    }
    return;
  }
  get(id << 1, l, (l + r) >> 1, L, R);
  if (tmp == 0) return;
  get((id << 1) + 1, ((l + r) >> 1) + 1, r, L, R);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &A[i]);
  build(1, 1, n);
  res = 0;
  for (int i = 1; i <= n; ++i) {
    moc = n + 1;
    tmp = 1;
    get(1, 1, n, i, n);
    res += (n - moc + 1);
  }
  printf("%lld", res);
  return 0;
}
