#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  if (n <= 1) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
void getUsefulPrimes(vector<int> &usefulPrimes, int k) {
  for (int i = 1; i * i <= k; i++) {
    if (k % i == 0) {
      if (isPrime(i)) usefulPrimes.push_back(i);
      if (k / i != i and isPrime(k / i)) usefulPrimes.push_back(k / i);
    }
  }
  sort(usefulPrimes.begin(), usefulPrimes.end());
}
void storePrimes(unordered_map<int, int> &m, vector<int> &primes, int n) {
  for (auto p : primes) {
    while (n % p == 0 and n > 1) {
      m[p]++;
      n /= p;
    }
  }
}
void removePrimes(unordered_map<int, int> &m, vector<int> &primes, int n) {
  for (auto p : primes) {
    while (n % p == 0 and n > 1) {
      m[p]--;
      n /= p;
    }
  }
}
bool atleast(unordered_map<int, int> m1, unordered_map<int, int> m2) {
  for (auto it : m1) {
    if (m2[it.first] < it.second) return false;
  }
  return true;
}
long long int solve(int arr[], int n, int k) {
  vector<int> usefulPrimes;
  getUsefulPrimes(usefulPrimes, k);
  unordered_map<int, int> vp, vq;
  storePrimes(vp, usefulPrimes, k);
  int i = 0, j = 0;
  long long int cnt = 0;
  while (j < n) {
    storePrimes(vq, usefulPrimes, arr[j]);
    while (i <= j and atleast(vp, vq)) {
      removePrimes(vq, usefulPrimes, arr[i]);
      cnt += (n - j);
      i++;
    }
    j++;
  }
  return cnt;
}
int main() {
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  long long int ans = solve(arr, n, k);
  cout << ans;
  return 0;
}
