#include <bits/stdc++.h>
using namespace std;
void brute(long long *a, long long n, long long k) {
  long long ans = 0, j = 0, p = -1, cur = 1;
  for (long long i = 0; i < n; i++) {
    while (j < n && cur % k != 0) {
      cur *= a[j];
      j++;
    }
    if (cur % k == 0) {
      ans += (i - p) * (n - j + 1);
      p = i;
    }
    cur /= a[i];
  }
  cout << ans << endl;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long t = 1;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    if (k == 1) {
      cout << n * (n + 1) / 2 << endl;
      return 0;
    }
    unordered_map<long long, long long> pf;
    set<long long> s;
    long long kk = k;
    for (long long i = 2; i * i <= k; i++) {
      long long cnt = 0;
      while (kk % i == 0) {
        cnt++;
        kk /= i;
      }
      if (cnt > 0) {
        s.insert(i);
        pf[i] = cnt;
      }
    }
    if (kk > 1) {
      pf[kk] = 1;
      s.insert(kk);
    }
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    unordered_map<long long, long long> mp[n];
    for (long long i = 0; i < n; i++) {
      for (long long x : s) {
        long long cnt = 0;
        while (a[i] % x == 0) {
          cnt++;
          a[i] /= x;
        }
        mp[i][x] = cnt;
        if (i > 0) mp[i][x] += mp[i - 1][x];
      }
    }
    auto check = [&](long long i, long long j) {
      for (long long x : s) {
        long long tt = mp[j][x];
        if (i > 0) tt -= mp[i - 1][x];
        if (tt < pf[x]) return false;
      }
      return true;
    };
    long long ans = 0;
    for (long long i = 0; i < n; i++) {
      long long l = i, r = n - 1, j = -1;
      while (l <= r) {
        long long m = (l + r) / 2;
        if (check(i, m)) {
          j = m;
          r = m - 1;
        } else
          l = m + 1;
      }
      if (j != -1) ans += (n - j);
    }
    cout << ans << endl;
  }
}
