#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;
long long int n, k, arr[nax];
vector<int> primes;
int cnt[nax];
void sieve(int n) {
  for (int i = 2; i <= n; i++) {
    if (cnt[i] == 0) {
      for (int j = 2 * i; j <= n; j += i) cnt[j] = 1;
    }
  }
  for (int i = 2; i <= n; i++)
    if (cnt[i] == 0) primes.push_back(i);
}
unordered_map<int, int> map1;
vector<pair<int, int> > factors[nax];
vector<int> facters;
void factorise(int num, vector<pair<int, int> > &fact) {
  for (auto x : facters) {
    if (num % x == 0) {
      int cnt = 0;
      while (num % x == 0) {
        num /= x;
        cnt++;
      }
      fact.push_back({cnt, x});
    }
  }
  if (num > 1) {
    fact.push_back({1, num});
  }
}
void factorize(int num) {
  for (int i = 0; i < primes.size() && primes[i] <= sqrt(num); i++) {
    if (num % primes[i] == 0) {
      int cnt = 0;
      while (num % primes[i] == 0) {
        num /= primes[i];
        cnt++;
      }
      facters.push_back(primes[i]);
      map1[primes[i]] = cnt;
    }
  }
  if (num > 1) {
    map1[num] = 1;
    facters.push_back(num);
  }
}
unordered_map<int, int> map2;
void removefrommap(int i) {
  for (auto x : factors[i]) map2[x.second] -= x.first;
}
void addtomap(int i) {
  for (auto x : factors[i]) map2[x.second] += x.first;
}
bool is() {
  for (auto x : map1) {
    int key = x.first;
    if (map2[key] < x.second) return false;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  sieve(1e5);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  if (k == 1) {
    cout << ((n) * (n + 1)) / 2;
    return 0;
  }
  factorize(k);
  for (int i = 1; i <= n; i++) {
    factorise(arr[i], factors[i]);
  }
  long long int ans = 0;
  int j = 0;
  for (int i = 1; i <= n; i++) {
    while (is() == false && j <= n) addtomap(j++ + 1);
    ans += (n - j + 1);
    removefrommap(i);
  }
  cout << ans;
  return 0;
}
