#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 123;
const long long infl = (long long)1e18 + 123;
const double eps = 1e-9;
const int MAX_N = (int)1e5 + 5;
const int mod = (int)1e9 + 7;
int n, k;
int a[MAX_N];
vector<pair<int, int> > q;
int cnt[20][MAX_N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 2; i * i <= k; i++) {
    if (k % i == 0) {
      int j = 0;
      while (k % i == 0) k /= i, j++;
      q.push_back(make_pair(i, j));
    }
  }
  if (k > 1) q.push_back(make_pair(k, 1));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    for (int j = 0; j < (int)((q).size()); j++) {
      cnt[j][i] = cnt[j][i - 1];
      while (a[i] % q[j].first == 0) a[i] /= q[j].first, cnt[j][i]++;
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int l = i, r = n, mid = -1, best = -1;
    while (l <= r) {
      mid = (l + r) / 2;
      bool bad = 0;
      for (int j = 0; j < (int)((q).size()); j++) {
        if (cnt[j][mid] - cnt[j][i - 1] < q[j].second) {
          bad = 1;
          break;
        }
      }
      if (bad)
        l = mid + 1;
      else {
        best = mid;
        r = mid - 1;
      }
    }
    if (best == -1) break;
    ans += (n - best + 1);
  }
  printf("%lld\n", ans);
  return 0;
}
