#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[100100];
int pri[100100], cnt[100100], num;
int now[100100];
bool judge() {
  for (int i = 0; i < num; ++i)
    if (now[i] < cnt[i]) return false;
  return true;
}
void add(int x) {
  for (int i = 0; i < num; ++i) {
    while (x % pri[i] == 0) {
      ++now[i];
      x /= pri[i];
    }
  }
}
void del(int x) {
  for (int i = 0; i < num; ++i) {
    while (x % pri[i] == 0) {
      --now[i];
      x /= pri[i];
    }
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 2; i < 100000; ++i) {
    if (k % i != 0) continue;
    pri[num] = i;
    while (k % i == 0) {
      ++cnt[num];
      k /= i;
    }
    num++;
  }
  if (k != 1) {
    pri[num] = k;
    cnt[num] = 1;
    ++num;
  }
  long long ans = 0;
  int p = 0;
  for (int i = 1; i <= n; ++i) {
    while (p < i) {
      p++;
      add(a[p]);
    }
    if (judge()) {
      ans += n - p + 1;
    } else {
      while (p < n && (!judge())) {
        p++;
        add(a[p]);
      }
      if (!judge()) break;
      ans += n - p + 1;
    }
    del(a[i]);
  }
  printf("%lld\n", ans);
  return 0;
}
