#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using pii = pair<int, int>;
const int SZ = 100000 + 10;
LL g_n, g_k;
LL in[SZ];
LL data[SZ << 4];
inline int ls(int rt) { return rt << 1; }
inline int rs(int rt) { return (rt << 1) | 1; }
void push_up(int rt) {
  data[rt] = (data[ls(rt)] % g_k) * (data[rs(rt)] % g_k) % g_k;
}
void built(int rt, int l, int r) {
  if (l == r) {
    data[rt] = in[l];
    return;
  }
  int md = (l + r) >> 1;
  built(ls(rt), l, md);
  built(rs(rt), md + 1, r);
  push_up(rt);
}
LL query(int rt, int l, int r, int u, int v) {
  if (u <= l && r <= v) {
    return data[rt];
  }
  int md = (l + r) >> 1;
  if (v <= md) {
    return query(ls(rt), l, md, u, v) % g_k;
  }
  if (u > md) {
    return query(rs(rt), md + 1, r, u, v) % g_k;
  }
  return (query(ls(rt), l, md, u, v) % g_k) *
         (query(rs(rt), md + 1, r, u, v) % g_k) % g_k;
}
void show(int rt, int l, int r) {
  cout << "rt:" << rt << " l:" << l << " r:" << r << " data:" << data[rt]
       << endl;
  if (l == r) return;
  int md = (l + r) >> 1;
  show(ls(rt), l, md);
  show(rs(rt), md + 1, r);
}
void prete() {}
void input() {
  for (int i = 1; i <= g_n; ++i) {
    scanf(" %I64d", in + i);
    in[i] %= g_k;
  }
}
void solve() {
  if (g_k == 1) {
    cout << g_n * (g_n + 1LL) / 2LL << endl;
    return;
  }
  built(1, 1, g_n);
  LL ans = 0;
  for (int i = 1; i <= g_n; ++i) {
    int l = i, r = g_n + 1, p = -1;
    while (r > l) {
      int md = (l + r) >> 1;
      if (!query(1, 1, g_n, i, md)) {
        p = md;
        r = md;
      } else {
        l = md + 1;
      }
    }
    if (p == -1) {
      break;
    }
    ans += (g_n - p + 1);
  }
  cout << ans << endl;
}
int main() {
  prete();
  while (cin >> g_n >> g_k) {
    input();
    solve();
  }
  return 0;
}
