#include <bits/stdc++.h>
using namespace std;
int arr[100001];
vector<vector<int> > v;
map<int, int> mp;
int n;
void prime_factors(int k) {
  vector<int> v3;
  for (int i = 2; i <= sqrt(k); i++) {
    if (k % i == 0) {
      v3.clear();
      v3.push_back(0);
      int cnt = 0;
      while (k % i == 0) {
        k /= i;
        cnt++;
      }
      mp[i] = cnt;
      for (int j = 1; j <= n; j++) {
        cnt = 0;
        int copy = arr[j];
        while (copy % i == 0) {
          copy /= i;
          cnt++;
        }
        v3.push_back(cnt + v3.back());
      }
      v.push_back(v3);
    }
  }
  if (k != 1) {
    v3.clear();
    v3.push_back(0);
    mp[k] = 1;
    for (int j = 1; j <= n; j++) {
      int cnt = 0;
      int copy = arr[j];
      while (copy % k == 0) {
        copy /= k;
        cnt++;
      }
      v3.push_back(cnt + v3.back());
    }
    v.push_back(v3);
  }
}
int f(int i, int left, int right) { return v[i][right] - v[i][left - 1]; }
int bs(int i, int left, int high, int cnt) {
  int low = left;
  while (low < high) {
    int mid = (low + high) / 2;
    if (f(i, left, mid) < cnt)
      low = mid + 1;
    else
      high = mid;
  }
  if (f(i, left, low) < cnt) return -1;
  return low;
}
int solve(int left) {
  int i = 0;
  int mx = 0;
  for (auto it : mp) {
    int cnt = it.second;
    int j = bs(i, left, n, cnt);
    mx = max(mx, j);
    if (j == -1) {
      return -1;
    }
    i++;
  }
  return mx;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> arr[i];
  long long int ans = 0;
  if (k == 1) {
    cout << (long long int)n * (n + 1) / 2;
    return 0;
  }
  prime_factors(k);
  for (int i = 1; i <= n; ++i) {
    int j = solve(i);
    if (j == -1) continue;
    ans += (long long int)(n - j + 1);
  }
  cout << ans;
  return 0;
}
