#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base ::sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  unordered_map<long long, long long> cnt_k;
  vector<long long> div;
  for (long long i = 2; i * i <= k + 10; i++) {
    if (k % i) {
      continue;
    }
    div.push_back(i);
    while (k % i == 0) {
      k /= i;
      cnt_k[i]++;
    }
  }
  if (k != 1) {
    div.push_back(k);
    cnt_k[k]++;
  }
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  unordered_map<long long, long long> cnt;
  long long l = -1;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long x = a[i];
    for (long long j : div) {
      while (x % j == 0) {
        x /= j;
        cnt[j]++;
      }
    }
    while (l < i) {
      bool f = false;
      for (long long j : div) {
        if (cnt_k[j] > cnt[j]) {
          f = true;
          break;
        }
      }
      if (f) {
        break;
      }
      l++;
      long long x = a[l];
      for (long long j : div) {
        while (x % j == 0) {
          x /= j;
          cnt[j]--;
        }
      }
    }
    ans += l + 1;
  }
  cout << ans;
  return 0;
}
