#include <bits/stdc++.h>
using namespace std;
vector<long long> prime;
long long a[100100][30], L, ans, cur[30], p[30];
bool is_prime(long long x) {
  if (x == 1) return false;
  for (long long i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
bool can() {
  for (long long i = 0; i < 30; i++)
    if (p[i] > cur[i]) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  if (k == 1) {
    cout << n * (n + 1) / 2 << endl;
    return 0;
  }
  for (long long i = 1; i * i <= k; i++)
    if (k % i == 0) {
      if (is_prime(i)) prime.push_back(i);
      if (is_prime(k / i)) prime.push_back(k / i);
    }
  for (long long i = 0; i < (long long)prime.size(); i++)
    while (k % prime[i] == 0) {
      k /= prime[i];
      p[i]++;
    }
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    for (long long j = 0; j < (long long)prime.size(); j++) {
      while (x % prime[j] == 0) {
        x /= prime[j];
        a[i][j]++;
        cur[j]++;
      }
    }
    while (can()) {
      for (long long j = 0; j < 30; j++) cur[j] -= a[L][j];
      L++;
    }
    ans += L;
  }
  cout << ans << endl;
  return 0;
}
