#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[100005];
int seg[4 * 100005];
int mid(int i, int j) { return (i + (j - i) / 2); }
void build(int node, int i, int j) {
  if (i == j) {
    seg[node] = a[i] % k;
  } else {
    build(2 * node, i, mid(i, j));
    build(2 * node + 1, mid(i, j) + 1, j);
    seg[node] = (seg[2 * node] * 1LL * seg[2 * node + 1]) % k;
  }
}
int query(int node, int i, int j, int l, int r) {
  if (i > r || l > j || i > j)
    return 1;
  else if (i >= l && j <= r)
    return seg[node];
  else
    return (query(2 * node, i, mid(i, j), l, r) * 1LL *
            query(2 * node + 1, mid(i, j) + 1, j, l, r) % k);
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  build(1, 1, n);
  long long int ans = 0;
  for (int i = 1; i <= n; i++) {
    int L = i;
    int R = n;
    int c = INT_MAX;
    while (L <= R) {
      int midi = mid(L, R);
      if (query(1, 1, n, i, midi) == 0) {
        c = min(c, midi);
        R = midi - 1;
      } else
        L = midi + 1;
    }
    if (c != INT_MAX) ans += (n - c + 1);
  }
  printf("%lld", ans);
  return 0;
}
