#include <bits/stdc++.h>
using namespace std;
inline long long prodm(long long a, long long b) {
  return ((a % 1000000007) * (b % 1000000007)) % 1000000007;
}
inline long long summ(long long a, long long b) {
  return ((a % 1000000007) + (b % 1000000007)) % 1000000007;
}
inline bool ispow2(long long x) { return x && (!(x & (x - 1))); }
const int NN = 1e6 + 5;
const int N = 1e9 + 9;
long long arr[NN];
long long sieve[NN];
vector<pair<int, int> > v;
vector<pair<int, int> > crt;
vector<int> primes;
void fillvect(long long k) {
  int i = 0;
  int count = 0;
  while (k > 0) {
    if (i >= (int)primes.size()) break;
    if (k % primes[i] == 0) {
      count++;
      k = k / primes[i];
    } else {
      if (count) v.push_back(make_pair(primes[i], count));
      i++;
      count = 0;
    }
  }
  if (k > 1) v.push_back(make_pair(k, 1));
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long i, j, n, k;
  for (i = 2; i <= sqrt(N); i++) {
    for (j = i * i; j <= sqrt(N); j += i) {
      sieve[j] = 1;
    }
  }
  for (i = 2; i <= sqrt(N); i++) {
    if (!sieve[i]) primes.push_back(i);
  }
  cin >> n >> k;
  for (i = 0; i < n; i++) cin >> arr[i];
  if (k == 1) {
    cout << n * (n + 1) / 2;
    return 0;
  }
  fillvect(k);
  primes.clear();
  for (auto u : v) {
    primes.push_back(u.first);
  }
  for (i = 0; i < (int)primes.size(); i++) {
    crt.push_back(make_pair(primes[i], 0));
  }
  long long ans = 0;
  j = 0;
  for (i = 0; i < n; i++) {
    long long op = arr[i];
    for (int k = 0; k < (int)primes.size(); k++) {
      int cnt = 0;
      while (op % primes[k] == 0) {
        cnt++;
        op = op / primes[k];
      }
      long long prev = crt[k].second;
      crt[k].first = primes[k];
      crt[k].second = prev + cnt;
    }
    int z;
    for (z = 0; z < (int)v.size(); z++) {
      if (v[z].second > crt[z].second) break;
    }
    if (z == (int)v.size()) {
      ans += n - i;
      for (int ii = j; ii <= i; ii++) {
        j++;
        long long op1 = arr[ii];
        for (int k = 0; k < (int)primes.size(); k++) {
          int cn = 0;
          while (op1 % primes[k] == 0) {
            cn++;
            op1 = op1 / primes[k];
          }
          long long prev = crt[k].second;
          crt[k].first = primes[k];
          crt[k].second = prev - cn;
        }
        int z;
        int flg = 0;
        for (z = 0; z < (int)v.size(); z++) {
          if (v[z].second > crt[z].second) {
            flg = 1;
            break;
          }
        }
        if (z == (int)v.size()) {
          ans = ans + n - i;
        }
        if (flg == 1) break;
      }
    }
  }
  cout << ans;
  return 0;
}
