#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
vector<int> vc, prime;
int vis[40000], lim = 39000, dp[20][200000], ara[20];
void solve() {
  vc.push_back(2);
  for (int i = 3; i <= lim; i += 2) {
    if (vis[i]) continue;
    vc.push_back(i);
    for (int j = i + i; j <= lim; j += i) vis[j] = 1;
  }
}
void getfit(int val, int indx) {
  for (int i = 1; i < prime.size(); i++) {
    int cnt = 0;
    while (val % prime[i] == 0) {
      val = val / prime[i];
      cnt++;
    }
    dp[i][indx] = dp[i][indx - 1] + cnt;
  }
}
int check(int indx, int mid) {
  for (int i = 1; i < prime.size(); i++) {
    int t = dp[i][mid] - dp[i][indx - 1];
    if (ara[i] > t) return 0;
  }
  return 1;
}
int binary(int i, int n) {
  int lo = i, high = n, mid, ans = 2000000;
  while (lo <= high) {
    mid = (lo + high) / 2;
    if (check(i, mid)) {
      high = mid - 1;
      ans = mid;
    } else
      lo = mid + 1;
  }
  return n - ans + 1;
}
int main() {
  prime.push_back(-3);
  solve();
  int i, j, k, l, m, n, tot = 0, q;
  scanf("%d%d", &n, &k);
  q = k;
  for (i = 0; i < vc.size() && vc[i] <= sqrt(q); i++) {
    if (q % vc[i] == 0) {
      prime.push_back(vc[i]);
      int cnt = 0;
      while (q % vc[i] == 0) {
        q = q / vc[i];
        cnt++;
      }
      ara[++tot] = cnt;
    }
  }
  if (q != 1) {
    prime.push_back(q);
    ara[++tot] = 1;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &l);
    getfit(l, i);
  }
  unsigned long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += max(0, binary(i, n));
  }
  cout << ans << endl;
}
