#include <bits/stdc++.h>
long long z = 1000000007;
long long inf = 100000000000000000;
long long gcd(long long a, long long b) {
  if (b > a) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long power(long long a, long long b) {
  if (b == 0) return 1;
  long long c = power(a, b / 2);
  if (b % 2 == 0)
    return ((c * c) % z);
  else
    return ((((c * c) % z) * a) % z);
}
long long inverse(long long a, long long n) { return power(a, n - 2); }
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
using namespace std;
int is_valid(vector<pair<long long, long long> >& req,
             vector<pair<long long, long long> >& curr) {
  for (long long i = 0; i < req.size(); i++) {
    if (req[i].second > curr[i].second) return 0;
  }
  return 1;
}
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<pair<long long, long long> > req;
  for (long long i = 2; i * i <= k; i++) {
    if (k % i == 0) {
      long long cnt = 0;
      while (k > 1 && (k % i == 0)) {
        k /= i;
        cnt++;
      }
      req.push_back(make_pair(i, cnt));
    }
  }
  if (k != 1) {
    req.push_back(make_pair(k, 1));
  }
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long ans = 0;
  long long curr_y = 0;
  vector<pair<long long, long long> > fact[n];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < req.size(); j++) {
      long long x = req[j].first;
      long long cnt = 0;
      while ((arr[i] % x) == 0) {
        cnt++;
        arr[i] /= x;
      }
      fact[i].push_back(make_pair(x, cnt));
    }
  }
  vector<pair<long long, long long> > curr;
  for (long long i = 0; i < fact[0].size(); i++) {
    curr.push_back(fact[0][i]);
  }
  for (long long curr_x = 0; curr_x < n; curr_x++) {
    if (curr_y < curr_x) {
      curr_y = curr_x;
      for (long long j = 0; j < req.size(); j++) {
        curr[j].second += fact[curr_x][j].second;
      }
    }
    if (curr_x > 0) {
      for (long long j = 0; j < req.size(); j++) {
        curr[j].second -= fact[curr_x - 1][j].second;
      }
    }
    while (!is_valid(req, curr)) {
      curr_y++;
      if (curr_y >= n) break;
      for (long long j = 0; j < req.size(); j++) {
        curr[j].second += fact[curr_y][j].second;
      }
    }
    ans += max(0, (n)-curr_y);
  }
  cout << ans << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
