#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, arr[100003];
  long long pro = 1, ans = 0;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", &arr[i]);
  int j = -1;
  for (int i = 0; i < n; i++) {
    pro = (pro * (arr[i] % k)) % k;
    if (pro == 0) {
      long long temp = 1;
      int l = i;
      while (1) {
        temp = (temp * (arr[l] % k)) % k;
        if (!temp) break;
        pro = temp;
        --l;
      }
      ans += (((long long)(l - j)) * (n - i));
      j = l;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
