#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  cin >> n >> k;
  if (k == 1) {
    cout << (n * (n + 1LL)) / 2 << '\n';
    return 0;
  }
  vector<pair<int, int>> fac;
  int new_k = k;
  for (int i = 2; i * i <= k; i++) {
    if (new_k % i == 0) {
      int cnt = 0;
      while (new_k % i == 0) {
        new_k /= i;
        cnt++;
      }
      fac.emplace_back(i, cnt);
    }
  }
  if (new_k > 1) fac.emplace_back(new_k, 1);
  int m = fac.size();
  vector<vector<int>> a(n, vector<int>(m));
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    for (int j = 0; j < m; j++) {
      int cnt = 0;
      int y = fac[j].first;
      while (x % y == 0) {
        x /= y;
        cnt++;
      }
      a[i][j] = cnt;
    }
  }
  int i = 0, j = 1;
  vector<int> tot = a[0];
  auto ok = [&](int jj) {
    for (int it = 0; it < m; it++) {
      int x = (jj == -1 ? 0 : a[jj][it]);
      if (tot[it] - x < fac[it].second) return false;
    }
    return true;
  };
  long long ans = 0;
  while (j <= n) {
    if (ok(-1)) {
      while (ok(i)) {
        for (int it = 0; it < m; it++) tot[it] -= a[i][it];
        i++;
      }
      ans += i + 1;
    }
    if (j < n)
      for (int it = 0; it < m; it++) tot[it] += a[j][it];
    j++;
  }
  cout << ans << '\n';
  return 0;
}
