#include <bits/stdc++.h>
using namespace std;
inline int _Int() {
  int x;
  scanf("%d", &x);
  return x;
}
long long int bigMod(long long int A, long long int P, int M) {
  long long int R = 1;
  for (A %= M; P; P >>= 1) {
    if (P & 1) R = (R * A) % M;
    A = (A * A) % M;
  }
  return R;
}
long long int bigMul(long long int A, long long int B, long long int M) {
  long long int R = 0;
  for (A %= M; B; B >>= 1) {
    if (B & 1) R = (R + A) % M;
    A = (A + A) % M;
  }
  return R;
}
long long int negMod(long long int A, long long int B) {
  return (((A % B) + B) % B);
}
long long int invMod(long long int A, long long int M) {
  return bigMod(A, M - 2, M);
}
unsigned long long int _pow(unsigned long long int A, int P) {
  unsigned long long int R = 1;
  for (; P; P >>= 1) {
    if (P & 1) R = (R * A);
    A = (A * A);
  }
  return R;
}
template <class T>
T GCD(T x, T y) {
  while (x) x ^= y ^= x ^= y %= x;
  return y;
}
template <class T>
bool inRng(T u, T v, T x) {
  return u <= x && x <= v;
}
const int M = 100000 + 7;
int n, k;
int A[M];
int tree[M << 2];
void build(int node, int u, int v) {
  if (u == v) {
    tree[node] = A[u] % k;
    return;
  }
  int mid = (u + v) >> 1, c1 = (node << 1);
  int c2 = c1 + 1;
  build(c1, u, mid);
  build(c2, mid + 1, v);
  long long int temp = tree[c1];
  temp = temp * tree[c2];
  tree[node] = temp % k;
}
int query(int node, int u, int v, int F, int T) {
  if (T < u || v < F) return 1;
  if (F <= u && v <= T) return tree[node];
  int mid = (u + v) >> 1, c1 = (node << 1);
  int c2 = c1 + 1;
  long long int temp = query(c1, u, mid, F, T);
  temp = temp * query(c2, mid + 1, v, F, T);
  return temp % k;
}
void Main() {
  n = _Int();
  k = _Int();
  for (int i = 0; i < n; i++) A[i] = _Int();
  build(1, 0, n - 1);
  long long int Ans = 0;
  for (int i = 0, j = 0; i < n; i++) {
    j = max(j, i);
    while (j < n && query(1, 0, n - 1, i, j)) j++;
    Ans += (n - j);
  }
  printf("%lld\n", Ans);
}
int main() {
  Main();
  return 0;
}
