#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>>* primeFactor(int n) {
  vector<pair<int, int>>* arr = new vector<pair<int, int>>();
  int j = -1;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      pair<int, int> p;
      p.first = i;
      p.second = 0;
      arr->push_back(p);
      j++;
      while (n % i == 0) {
        n = n / i;
        arr->at(j).second += 1;
      }
    }
  }
  if (n > 1) {
    pair<int, int> p;
    p.first = n;
    p.second = 1;
    arr->push_back(p);
  }
  return arr;
}
bool compare(vector<pair<int, int>>& a, vector<pair<int, int>>& b) {
  assert(a.size() == b.size());
  for (int i = 0; i < b.size(); i++) {
    if (a[i].second < b[i].second) return false;
  }
  return true;
}
void add(int num, vector<pair<int, int>>& arr) {
  for (int i = 0; i < arr.size() && num != 1; i++) {
    while (num % arr[i].first == 0) {
      arr[i].second += 1;
      num = num / arr[i].first;
    }
  }
}
void sub(int num, vector<pair<int, int>>& arr) {
  for (int i = 0; i < arr.size() && num != 1; i++) {
    while (num % arr[i].first == 0) {
      arr[i].second -= 1;
      assert(arr[i].second >= 0);
      num = num / arr[i].first;
    }
  }
}
int main() {
  int n, k, i, j;
  long long ans;
  cin >> n >> k;
  vector<pair<int, int>>* prima = primeFactor(k);
  vector<pair<int, int>>& primek = *prima;
  int* arr = new int[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  ans = i = j = 0;
  vector<pair<int, int>> num = primek;
  for (int i = 0; i < num.size(); i++) num[i].second = 0;
  for (j = 0; j < n; j++) {
    add(arr[j], num);
    while (i <= j && compare(num, primek)) {
      sub(arr[i], num);
      ans += (n - j);
      i++;
    }
  }
  cout << ans;
  return 0;
}
