#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N];
vector<int> adj[N];
int n, k, done;
vector<int> v;
vector<int> cnt;
vector<int> cur;
void solve(int idx) {
  int num = a[idx];
  for (int i = 0; i < int(int(v.size())); i++) {
    int c = 0;
    while (num % v[i] == 0) {
      c++;
      num /= v[i];
    }
    adj[idx][i] = c;
  }
}
void add(int idx) {
  for (int i = 0; i < int(int(v.size())); i++) {
    if (cur[i] < cnt[i] && cur[i] + adj[idx][i] >= cnt[i]) done++;
    cur[i] += adj[idx][i];
  }
}
void del(int idx) {
  for (int i = 0; i < int(int(v.size())); i++) {
    if (cur[i] >= cnt[i] && cur[i] - adj[idx][i] < cnt[i]) done--;
    cur[i] -= adj[idx][i];
  }
}
int main() {
  scanf("%d %d", &n, &k);
  long long ans = 0;
  if (k == 1) {
    for (int e = 0; e < int(n); e++) {
      ans += (n - e);
    }
  } else {
    for (int i = 2; i * i <= k; i++) {
      if (k % i == 0) {
        v.push_back(i);
        int c = 0;
        while (k % i == 0) {
          k /= i;
          c++;
        }
        cnt.push_back(c);
        cur.push_back(0);
      }
    }
    if (k > 1) {
      v.push_back(k);
      cnt.push_back(1);
      cur.push_back(0);
    }
    for (int i = 0; i < int(n); i++) {
      scanf("%d", &a[i]);
      adj[i].resize(int(v.size()) + 1);
      solve(i);
    }
    int e = 0;
    for (int i = 0; i < int(n); i++) {
      while (e < n && done < int(v.size())) {
        add(e);
        e++;
      }
      if (done == int(v.size())) ans += (n - e + 1);
      del(i);
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
