#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k, a[maxn], cnt[100][maxn], cntK[maxn];
long long ans;
vector<int> fac;
void Solve(int st) {
  int ed = -1;
  for (int i = 0; i < fac.size(); i++) {
    int pos =
        lower_bound(cnt[i] + st, cnt[i] + 1 + n, cntK[i] + cnt[i][st - 1]) -
        cnt[i];
    ed = max(ed, pos);
  }
  ans += (long long)((ed == -1) ? 0 : n + 1 - ed);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  if (k == 1) {
    printf("%lld\n", (long long)n * (n + 1) / 2);
    return 0;
  }
  for (int i = 2; i * i <= k; i++) {
    if (k % i == 0) {
      fac.push_back(i);
      while (k % i == 0) k /= i, cntK[fac.size() - 1]++;
    }
  }
  if (k != 1) fac.push_back(k), cntK[fac.size() - 1]++;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < fac.size(); j++) {
      while (a[i] % fac[j] == 0) {
        cnt[j][i]++;
        a[i] /= fac[j];
      }
    }
  }
  for (int i = 0; i < fac.size(); i++) {
    for (int j = 1; j <= n; j++) cnt[i][j] += cnt[i][j - 1];
  }
  for (int i = 1; i <= n; i++) Solve(i);
  printf("%lld\n", ans);
  return 0;
}
