#include <bits/stdc++.h>
using namespace std;
int n, k, a[100005];
long long dp[100005][20];
void init() {
  for (int i = 0; i < n; i++) dp[i][0] = a[i];
  for (int j = 1; j < 20; j++)
    for (int i = 0; i < n; i++)
      if (i + (1 << (j - 1)) < n)
        dp[i][j] = (dp[i][j - 1] * dp[i + (1 << (j - 1))][j - 1]) % k;
}
long long get_mul(int i, int r) {
  int m = r - i + 1;
  long long rt = 1;
  for (int j = 20 - 1; j >= 0; j--) {
    if (m & (1 << j)) {
      rt = rt * dp[i][j] % k;
      i += (1 << j);
    }
  }
  return rt;
}
long long solve() {
  init();
  long long sum = 0;
  int j = 1;
  for (int i = 0; i < n; i++) {
    j = max(i + 1, j);
    long long mul = get_mul(i, j - 1);
    while (mul) {
      if (j == n) return sum;
      mul = (mul * a[j]) % k;
      j++;
    }
    sum += n - j + 1;
  }
  return sum;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  if (k == 1)
    cout << 1ll * n * (n + 1) / 2;
  else
    cout << solve() << endl;
  return 0;
}
