#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, k, a[N];
long long ST[4 * N];
void build(int id, int l, int r) {
  if (l == r) {
    ST[id] = a[l] % k;
    return;
  }
  int mid = (l + r) / 2;
  build(id * 2, l, mid);
  build(id * 2 + 1, mid + 1, r);
  ST[id] = (ST[id * 2] * ST[id * 2 + 1]) % k;
}
long long get(int id, int l, int r, int L, int R) {
  if (r < L || R < l) return 1;
  if (L <= l && r <= R) return ST[id];
  int mid = (l + r) / 2;
  return (get(id * 2, l, mid, L, R) * get(id * 2 + 1, mid + 1, r, L, R)) % k;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  build(1, 1, n);
  int r = 1;
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    r = max(r, i);
    while (r <= n && get(1, 1, n, i, r) != 0) r++;
    res = res + 1ll * (n - r + 1);
  }
  cout << res;
}
