#include <bits/stdc++.h>
using namespace std;
int a[101010], t[101010], g[101010], n, k;
bool p[101010];
void go(int p) {
  int nd = 0;
  while (k % p == 0) {
    nd++;
    k /= p;
  }
  for (int i = 0; i < n; i++) {
    g[i] = 0;
    while (a[i] % p == 0) {
      g[i]++;
      a[i] /= p;
    }
  }
  for (int i = 0, c = 0, j = -1; i < n; i++) {
    while (j < n && c < nd) c += g[++j];
    t[i] = max(t[i], j);
    c -= g[i];
  }
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (k == 1) {
    return cout << (long long)(n) * (n + 1) / 2, 0;
  }
  for (int i = 2; i < 101010; i++) {
    if (!p[i]) {
      if (k % i == 0) go(i);
      for (int j = i; j < 101010; j += i) p[j] = true;
    }
  }
  if (k > 1) go(k);
  long long ans = 0;
  for (int i = 0; i < n; i++) ans += n - t[i];
  return cout << ans, 0;
}
