#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  long long k;
  cin >> n >> k;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long x = k;
  long long ans = 0;
  vector<pair<int, int>> primefactor;
  for (int i = 2; i * i <= k; i++) {
    int count = 0;
    while (k % i == 0) {
      k = k / i;
      count++;
    }
    if (count != 0) {
      primefactor.push_back({i, count});
    }
  }
  if (k != 1) {
    primefactor.push_back({k, 1});
  }
  vector<pair<int, int>> copy = primefactor;
  for (int i = 0; i < primefactor.size(); i++) {
    copy[i].second = 0;
  }
  int i = 0;
  int j = 0;
  for (int i = 0; i < n; i++) {
    for (int z = 0; z < primefactor.size(); z++) {
      if (arr[i] % primefactor[z].first == 0) {
        int count = 0;
        int x = arr[i];
        while (x % primefactor[z].first == 0) {
          x /= primefactor[z].first;
          count++;
        }
        copy[z].second += count;
      }
    }
    while (j <= i) {
      int z;
      for (z = 0; z < primefactor.size(); z++) {
        if (primefactor[z].second > copy[z].second) {
          break;
        }
      }
      if (z != primefactor.size()) {
        break;
      }
      ans += n - i;
      for (int z = 0; z < primefactor.size(); z++) {
        if (arr[j] % primefactor[z].first == 0) {
          int count = 0;
          int x = arr[j];
          while (x % primefactor[z].first == 0) {
            x /= primefactor[z].first;
            count++;
          }
          copy[z].second -= count;
        }
      }
      j++;
    }
  }
  cout << ans << "\n";
  return 0;
}
