#include <bits/stdc++.h>
using namespace std;
const long long Inf = 1e9 + 7;
namespace myspace {
const int N = 1e5 + 7;
int n;
long long k, a[N];
vector<pair<int, int> > decompose(long long x) {
  vector<pair<int, int> > res;
  res.push_back({1, 1});
  for (long long d = 2; d * d <= x; d++) {
    int cnt = 0;
    while (x % d == 0) {
      x /= d;
      cnt++;
    }
    if (cnt > 0) {
      res.push_back({d, cnt});
    }
  }
  if (x > 1) res.push_back({x, 1});
  return res;
}
void update(vector<pair<int, int> >& cf, long long x, int mode) {
  cf[0].second += mode;
  for (int i = 1; i < cf.size(); i++) {
    while (x % cf[i].first == 0) {
      x /= cf[i].first;
      cf[i].second += mode;
    }
  }
}
bool check(const vector<pair<int, int> >& pf,
           const vector<pair<int, int> >& cf) {
  for (int i = 0; i < pf.size(); i++)
    if (cf[i].second < pf[i].second) return false;
  return true;
}
void solve() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<pair<int, int> > pf = decompose(k);
  vector<pair<int, int> > cf = pf;
  for (int i = 0; i < cf.size(); i++) cf[i].second = 0;
  int l = 0, r = 1;
  long long res = 0;
  update(cf, a[l], 1);
  while (l < n) {
    while (r < n && !check(pf, cf)) {
      update(cf, a[r], 1);
      r++;
    }
    if (check(pf, cf)) res += n - r + 1;
    update(cf, a[l], -1);
    l++;
  }
  cout << res << '\n';
}
};  // namespace myspace
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(9);
  cout << fixed;
  myspace::solve();
  return 0;
}
