#include <bits/stdc++.h>
using namespace std;
const int MaxN = 2e5 + 121, MaxD = 25;
int pr[MaxN][MaxD], kol, n, k, cnt[MaxD], Cnt, num, d[MaxD];
long long ans;
map<int, int> mp;
char f(int l, int r) {
  for (int i = 1; i <= kol; ++i) {
    if (pr[r][i] - pr[l - 1][i] < cnt[i]) return 0;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (int j = 2; j * 1ll * j <= k; ++j) {
    if (k % j == 0) {
      d[++kol] = j;
      mp[j] = kol;
      while (k % j == 0) k /= j, ++cnt[kol];
    }
  }
  if (k > 1) {
    d[++kol] = k;
    mp[k] = kol;
    cnt[kol] = 1;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= kol; ++j) pr[i][j] = pr[i - 1][j];
    cin >> k;
    for (int j = 1; j <= kol; ++j) {
      Cnt = 0;
      int jj = d[j];
      while (k % jj == 0) k /= jj, ++Cnt;
      pr[i][j] += Cnt;
    }
  }
  for (int i = 1; i <= n; ++i) {
    int l = i, r = n;
    while (l + 1 < r) {
      int mid = (l + r) >> 1;
      if (f(i, mid))
        r = mid;
      else
        l = mid + 1;
    }
    if (f(i, l))
      ans += n - l + 1;
    else if (f(i, r))
      ans += n - r + 1;
  }
  cout << ans << '\n';
  return 0;
}
