#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  unordered_map<int, int> m;
  for (int i = 2; i <= sqrt(k) + 1;) {
    if (k % i)
      ++i;
    else {
      m[i]++;
      k /= i;
    }
  }
  if (k != 1) m[k]++;
  unordered_map<int, int> f[n + 1];
  for (auto &p : m) {
    f[0][p.first] = 0;
  }
  int c[n];
  for (int i = 0; i < n; ++i) {
    cin >> c[i];
    f[i + 1] = f[i];
    for (auto &p : f[i + 1]) {
      while (c[i] % p.first == 0) {
        c[i] /= p.first;
        p.second++;
      }
    }
  }
  long long tot = 0;
  for (int i = 1; i <= n; ++i) {
    int l = 0, r = i, mid;
    bool bad = false;
    while (l < r) {
      mid = (l + r) / 2;
      bad = false;
      for (auto &p : m) {
        if (f[i][p.first] - f[mid][p.first] < p.second) {
          bad = true;
          break;
        }
      }
      if (bad) {
        r = mid;
      } else {
        if (l == mid) break;
        l = mid;
      }
    }
    if (bad) continue;
    tot += (long long)(l + 1);
  }
  cout << tot << "\n";
}
