#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
long long p[MAXN], a[MAXN], tree[4 * MAXN];
long long K;
int base;
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
void update(int pos, int val) {
  tree[pos += base - 1] *= val;
  tree[pos] %= K;
  for (; pos > 1; pos /= 2) {
    tree[pos / 2] = tree[pos] * tree[pos ^ 1];
    tree[pos / 2] %= K;
  }
}
long long query(int l, int r) {
  l += base - 1;
  r += base - 1;
  long long ret = 1;
  for (; l <= r; l /= 2, r /= 2) {
    if (l & 1) {
      ret *= tree[l++];
      ret %= K;
    }
    if (~r & 1) {
      ret *= tree[r--];
      ret %= K;
    }
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  K = k;
  for (int i = 0; i < 4 * MAXN; i++) tree[i] = 1;
  for (base = 1; base < n; base *= 2)
    ;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    p[i] = GCD(a[i], k);
    update(i, p[i]);
  }
  int j = 1;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    j = max(i, j);
    while (j <= n && query(i, j) != 0) j++;
    ans += n - j + 1;
  }
  cout << ans;
  return 0;
}
