#include <bits/stdc++.h>
using namespace std;
int N, K, P, pr[12], put[12], a[100100], r[100100];
void rmv(int &cnt, int nr, int p) {
  while (nr % p == 0) cnt--, nr /= p;
}
void add(int &cnt, int nr, int p) {
  while (nr % p == 0) cnt++, nr /= p;
}
void getr() {
  int i, cr = 0, crp = 0;
  for (i = 1; i <= N; i++) {
    if (i != 1) rmv(crp, a[i - 1], pr[P]);
    while (cr <= N && crp < put[P]) {
      cr++;
      if (cr <= N) add(crp, a[cr], pr[P]);
    }
    r[i] = max(r[i], cr);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> K;
  int i;
  for (i = 1; i <= N; i++) {
    cin >> a[i];
    r[i] = i;
  }
  for (i = 2; i * i <= K; i++)
    if (K % i == 0) {
      pr[++P] = i;
      while (K % i == 0) put[P]++, K /= i;
      getr();
    }
  if (K > 1) {
    pr[++P] = K;
    put[P] = 1;
    getr();
  }
  long long res = 0;
  for (i = 1; i <= N; i++) res += N - r[i] + 1;
  cout << res << "\n";
  return 0;
}
