#include <bits/stdc++.h>
using namespace std;
int n, pw2;
long long k;
long long a[100005], t[100005 * 4];
long long query(int l, int r) {
  if (l >= r) return 1ll;
  long long ans = 1ll;
  for (l += pw2, r += pw2; l < r; l >>= 1, r >>= 1) {
    if (l & 1) ans = (ans * t[l++]) % k;
    if (r & 1) ans = (ans * t[--r]) % k;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (pw2 = 1; pw2 < n; pw2 <<= 1)
    ;
  for (int i = 0; i < pw2; i++) t[pw2 + i] = 1ll;
  for (int i = 0; i < n; i++) t[pw2 + i] = a[i] % k;
  for (int i = pw2 - 1; i > 0; i--) t[i] = (t[i * 2] * t[i * 2 + 1]) % k;
  long long ret = 0ll;
  for (int i = 0; i < n; i++) {
    int lo = i, hi = n - 1;
    while (lo < hi) {
      int mid = (lo + hi) >> 1;
      if (!query(i, mid + 1))
        hi = mid;
      else
        lo = mid + 1;
    }
    if (!query(i, hi + 1)) {
      ret += (n - hi);
    }
  }
  cout << ret << endl;
  return 0;
}
