#include <bits/stdc++.h>
using namespace std;
int n, k, a[101010];
map<int, int> cnt, ck;
long long ans = 0;
void div() {
  int x = k;
  for (int i = 2; i * i <= k; ++i)
    while (x % i == 0) ++ck[i], x /= i;
  if (x > 1) ++ck[x];
}
int calc(int x, int y) {
  int t = 0;
  while (x % y == 0) ++t, x /= y;
  return t;
}
bool check(int x) {
  for (map<int, int>::iterator it = ck.begin(); it != ck.end(); ++it)
    if (cnt[it->first] - calc(x, it->first) < it->second) return false;
  return true;
}
void modify(int x, int v) {
  for (map<int, int>::iterator it = ck.begin(); it != ck.end(); ++it)
    cnt[it->first] += calc(x, it->first) * v;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  div();
  for (int i = 1, j = 1; i <= n; ++i) {
    modify(a[i], 1);
    if (!check(1)) continue;
    while (j < i && check(a[j])) modify(a[j++], -1);
    ans += j;
  }
  cout << ans << endl;
  return 0;
}
