#include <bits/stdc++.h>
using namespace std;
const int maxd = 33;
const int maxn = 100100;
vector<int> fatores;
int cnt[maxd][maxn];
int need[maxd];
void initFatores(int k) {
  for (int e = 2; e <= 100000; e++) {
    if (k % e == 0) {
      while (k % e == 0) {
        need[fatores.size()]++;
        k /= e;
      }
      fatores.push_back(e);
    }
  }
  if (k != 1) {
    need[fatores.size()]++;
    fatores.push_back(k);
  }
}
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  if (k == 1) {
    long long ans = 0;
    for (int e = 0; e < n; e++) {
      ans += (n - e);
    }
    printf("%lld\n", ans);
    return 0;
  }
  initFatores(k);
  for (int e = 1; e <= n; e++) {
    int x;
    scanf("%d", &x);
    for (int f = 0; f < fatores.size(); f++) {
      int here = fatores[f];
      while (x % here == 0) {
        cnt[f][e]++;
        x /= here;
      }
    }
    for (int f = 0; f < fatores.size(); f++) cnt[f][e] += cnt[f][e - 1];
  }
  long long ans = 0;
  for (int e = 0; e <= n; e++) {
    int lo = e + 1, hi = n, ptr = -1;
    while (lo <= hi) {
      int mid = (lo + hi) >> 1;
      bool ok = true;
      for (int f = 0; f < fatores.size(); f++)
        ok &= cnt[f][mid] - cnt[f][e] >= need[f];
      if (ok)
        ptr = mid, hi = mid - 1;
      else
        lo = mid + 1;
    }
    if (ptr != -1) ans += (n - ptr + 1);
  }
  printf("%lld\n", ans);
  return 0;
}
