#include <bits/stdc++.h>
using namespace std;
long long int em(long long int x, long long int Mod, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return em((x % Mod * x % Mod) % Mod, Mod, n / 2);
  else
    return (x % Mod * em((x % Mod * x % Mod) % Mod, Mod, (n - 1) / 2)) % Mod;
}
vector<long long int> divi;
map<long long int, long long int> ma;
map<long long int, long long int> ma1[1000009];
void primediv(long long int x) {
  long long int i;
  for (i = 2; i <= sqrt(x); i++) {
    long long int c = 0;
    while ((x % i) == 0) {
      c++;
      x = x / i;
    }
    if (c > 0) {
      ma[i] = c;
      divi.push_back(i);
    }
  }
  if (x > 1) {
    ma[x] = 1;
    divi.push_back(x);
  }
}
long long int arr[1000009];
int32_t main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k, i, j, l;
  cin >> n >> k;
  primediv(k);
  for (long long int i = (long long int)0; i < (long long int)n; i++) {
    cin >> arr[i];
    auto itr = ma.begin();
    for (; itr != ma.end(); itr++) {
      long long int c = 0;
      long long int d = itr->first;
      long long int u = arr[i];
      while (u % d == 0) {
        c++;
        u = u / d;
      }
      ma1[i + 1][d] = c + ma1[i][d];
    }
  }
  long long int fans = 0;
  for (long long int i = (long long int)0; i < (long long int)n; i++) {
    long long int lo = i + 1, hi = n;
    long long int ans = n + 1;
    while (lo <= hi) {
      long long int mid = (lo + hi) / 2;
      long long int f = 0;
      for (long long int y : divi) {
        if (ma[y] > ma1[mid][y] - ma1[i][y]) {
          f = 1;
          break;
        }
      }
      if (f == 1)
        lo = mid + 1;
      else {
        ans = min(ans, mid);
        hi = mid - 1;
      }
    }
    fans += (n - ans + 1);
  }
  cout << fans;
}
