#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > fc;
vector<int> fr;
int x[100000];
bool ok() {
  for (int i = 0; i < (int)(fc.size()); ++i)
    if (fr[i] < fc[i].second) return false;
  return true;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 2; i * i <= k; ++i)
    if (k % i == 0) {
      int z = 1;
      k /= i;
      while (k % i == 0) k /= i, ++z;
      fc.push_back(make_pair(i, z));
    }
  if (k > 1) fc.push_back(make_pair(k, 1));
  fr.resize(fc.size());
  int l = 0;
  long long an = 0;
  for (int i = 0; i < (int)(n); ++i) {
    scanf("%d", x + i);
    int t = x[i];
    for (int j = 0; j < (int)(fc.size()); ++j)
      while (t % fc[j].first == 0) ++fr[j], t /= fc[j].first;
    while (l <= i && ok()) {
      int t = x[l++];
      for (int j = 0; j < (int)(fc.size()); ++j)
        while (t % fc[j].first == 0) --fr[j], t /= fc[j].first;
    }
    an += l;
  }
  printf("%lld\n", an);
}
