#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
int ct[100010][30];
int sieve[1000010];
int sz = 0;
long long tot = 0;
int func(int i, int mid) {
  for (int j = 0; j < sz; j++) {
    if (ct[mid][j] - ct[i - 1][j] < v[j].second) return 0;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, i, j, k, x;
  cin >> n >> k;
  int lim = sqrt(1e9 + 7) + 2;
  for (int i = 2; i <= lim; i++) {
    if (!sieve[i]) {
      for (j = i * i; j <= lim; j += i) {
        if (!sieve[j]) sieve[j] = 1;
      }
      if (k % i == 0) {
        int cnt = 0;
        while (k % i == 0) {
          k = k / i;
          cnt++;
        }
        sz++;
        v.push_back(make_pair(i, cnt));
      }
    }
  }
  if (k > 1) {
    v.push_back(make_pair(k, 1));
    sz++;
  }
  for (i = 1; i <= n; i++) {
    cin >> x;
    for (j = 0; j < sz; j++) {
      int cnt = 0, temp = x;
      while (temp % v[j].first == 0) {
        temp /= v[j].first;
        cnt++;
      }
      ct[i][j] = ct[i - 1][j] + cnt;
    }
  }
  for (i = 1; i <= n; i++) {
    int lo = i, hi = n;
    int mid = (lo + hi) >> 1;
    int ans = n + 1;
    while (lo <= mid) {
      if (func(i, mid)) {
        ans = mid;
        hi = mid - 1;
      } else
        lo = mid + 1;
      mid = (lo + hi) >> 1;
    }
    tot += (long long)(n - ans + 1);
  }
  cout << tot << "\n";
  return 0;
}
