#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int num[N][30], a[N], z[N];
vector<int> p;
int si[30], sum[N][30];
void init(int x) {
  int w = 0;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      p.push_back(i);
      while (x % i == 0) {
        x /= i;
        si[w]++;
      }
      w++;
    }
  }
  if (x != 1) p.push_back(x), si[w] = 1;
}
int check(int L, int R) {
  for (int i = 0; i < p.size(); i++)
    if (sum[R][i] - sum[L - 1][i] < si[i]) return 0;
  return 1;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  init(k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    int w = a[i];
    for (int j = 0; j < p.size(); j++) {
      while (w % p[j] == 0) {
        w /= p[j];
        num[i][j]++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < p.size(); j++) sum[i][j] = sum[i - 1][j] + num[i][j];
  }
  for (int L = 1, R = 0; L <= n; L++) {
    while (check(L, R) == 0 && R <= n) R++;
    R = max(R, L);
    if (check(L, R))
      z[L] = R;
    else
      z[L] = n + 1;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans += n - z[i] + 1;
  printf("%lld\n", ans);
  return 0;
}
