#include <bits/stdc++.h>
using namespace std;
template <class T>
struct Seg {
  const T ID = 1;
  long long n, k;
  vector<T> seg;
  T comb(T a, T b) { return (a * b) % k; }
  Seg(long long _n, long long _k) {
    n = _n;
    k = _k;
    seg.resize(2 * n);
  }
  void pull(long long p) { seg[p] = comb(seg[2 * p], seg[2 * p + 1]); }
  void upd(long long p, T value) {
    seg[p += n] = value;
    for (p /= 2; p; p /= 2) pull(p);
  }
  T query(long long l, long long r) {
    T ra = ID, rb = ID;
    for (l += n, r += n + 1; l < r; l /= 2, r /= 2) {
      if (l & 1) ra = comb(ra, seg[l++]);
      if (r & 1) rb = comb(seg[--r], rb);
    }
    return comb(ra, rb);
  }
};
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  for (long long &i : v) cin >> i;
  Seg<long long> seg_tree(n, k);
  for (long long i = 0; i < n; i++) {
    seg_tree.upd(i, v[i]);
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long l = 0, r = i;
    while (l < r) {
      long long mid = (l + r + 1) / 2;
      if (seg_tree.query(mid, i) == 0)
        l = mid;
      else
        r = mid - 1;
    }
    if (seg_tree.query(l, i) == 0) {
      ans += (l + 1);
    }
  }
  cout << ans << "\n";
  return 0;
}
