#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k, a[maxn], cnt[100][maxn], cntK[maxn], cntCur[maxn];
long long ans;
vector<int> fac;
bool ok = false;
bool cal(int x, int val) {
  for (int i = 0; i < fac.size(); i++) cntCur[i] += val * cnt[i][x];
  bool t = true;
  for (int i = 0; i < fac.size() && t; i++)
    if (cntCur[i] < cntK[i]) t = false;
  return t;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  if (k == 1) {
    printf("%lld\n", (long long)n * (n + 1) / 2);
    return 0;
  }
  for (int i = 2; i * i <= k; i++) {
    if (k % i == 0) {
      fac.push_back(i);
      while (k % i == 0) k /= i, cntK[fac.size() - 1]++;
    }
  }
  if (k != 1) fac.push_back(k), cntK[fac.size() - 1]++;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < fac.size(); j++) {
      while (a[i] % fac[j] == 0) {
        cnt[j][i]++;
        a[i] /= fac[j];
      }
    }
  }
  int l = 1, r = 1;
  while (l <= n) {
    while (!ok && r <= n) {
      ok = cal(r, 1);
      r++;
    }
    if (ok) ans += n + 2 - r;
    ok = cal(l, -1);
    l++;
  }
  printf("%lld\n", ans);
  return 0;
}
