#include <bits/stdc++.h>
using namespace std;
struct tree {
  long long mod;
  vector<long long> t;
  tree(int a[], int n, int k) {
    t = vector<long long>(4 * n + 4, 0);
    mod = k;
    build(a, 1, 1, n);
  }
  void build(int a[], int node, int low, int high) {
    if (low == high)
      t[node] = a[low] % mod;
    else {
      int mid = (low + high) >> 1, left = node << 1, right = left | 1;
      build(a, left, low, mid), build(a, right, mid + 1, high);
      t[node] = (t[left] * t[right]) % mod;
    }
  }
  long long query(int node, int low, int high, int l, int r) {
    if (low > r || high < l) return 1;
    if (l <= low && high <= r) return t[node];
    int mid = (low + high) >> 1, left = node << 1, right = left | 1;
    return (query(left, low, mid, l, r) * query(right, mid + 1, high, l, r)) %
           mod;
  }
};
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int a[n + 1];
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  tree T(a, n, k);
  long long last = 1, ans = 0;
  for (long long i = 1; i <= n; ++i) {
    last = max(last, i);
    while ((last <= n) && (T.query(1, 1, n, i, last))) {
      ++last;
    }
    if (last > n) break;
    ans += (n - last + 1);
  }
  printf("%lld\n", ans);
  return 0;
}
