#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<pair<int, int> > f;
int a[100007];
int pref[11][100007];
long long res;
bool check(int a, int b) {
  for (int i = 0; i < f.size(); ++i) {
    if (f[i].second > pref[i][b] - pref[i][a]) return 0;
  }
  return 1;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  int curr = k;
  for (int i = 2; i * i <= k; ++i) {
    if (curr % i == 0) {
      f.emplace_back(i, 1);
      curr /= i;
    }
    while (curr % i == 0) {
      ++f.back().second;
      curr /= i;
    }
  }
  if (curr > 1) f.emplace_back(curr, 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < f.size(); ++j) {
      while (a[i] % f[j].first == 0) {
        a[i] /= f[j].first;
        ++pref[j][i];
      }
      pref[j][i] += pref[j][i - 1];
    }
  }
  for (int i = 0; i < n; ++i) {
    int l = i + 1, r = n;
    while (l < r) {
      int m = (l + r) / 2;
      if (m == r) --m;
      if (check(i, m))
        r = m;
      else
        l = m + 1;
    }
    if (check(i, l)) res += n - l + 1;
  }
  cout << res;
}
