#include <bits/stdc++.h>
using namespace std;
map<long long, long long> prime_factor(long long n) {
  map<long long, long long> res;
  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n] = 1;
  return res;
}
map<long long, long long> prime_factor2(long long n,
                                        map<long long, long long> pk) {
  map<long long, long long> res;
  for (pair<long long, long long> p : pk) {
    while (n % p.first == 0) {
      res[p.first]++;
      n /= p.first;
    }
  }
  return res;
}
long long n, k;
long long a[111111];
int main() {
  cin >> n >> k;
  for (long long i = (long long)(0); i < (long long)(n); i++) cin >> a[i];
  if (k == 1) {
    cout << n * (n + 1) / 2 << endl;
    return 0;
  }
  map<long long, long long> pk = prime_factor(k);
  map<long long, long long> crt;
  long long res = 0, r = 0;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    for (; r < n; r++) {
      bool ok = true;
      for (pair<long long, long long> p : pk) {
        if (crt.count(p.first) == 0 || crt[p.first] < p.second) ok = false;
      }
      if (ok) break;
      map<long long, long long> ps = prime_factor2(a[r], pk);
      for (pair<long long, long long> p : ps) {
        crt[p.first] += p.second;
      }
    }
    if (r == n) {
      bool ok = true;
      for (pair<long long, long long> p : pk) {
        if (crt.count(p.first) == 0 || crt[p.first] < p.second) ok = false;
      }
      if (!ok) break;
    }
    res += n - r + 1;
    map<long long, long long> ps = prime_factor2(a[i], pk);
    for (pair<long long, long long> p : ps) {
      crt[p.first] = max(0LL, crt[p.first] - p.second);
    }
    if (r == n) {
      bool ok = true;
      for (pair<long long, long long> p : pk) {
        if (crt.count(p.first) == 0 || crt[p.first] < p.second) ok = false;
      }
      if (!ok) break;
    }
  }
  cout << res << endl;
  return 0;
}
