#include <bits/stdc++.h>
using namespace std;
long long n, k, acc[1000006][33], r[33], cnt[33], ans;
vector<pair<int, int> > v;
void decomp(long long x) {
  for (long long i = 2; i * i <= x; i++) {
    int xp = 0;
    while (x % i == 0) {
      xp++;
      x /= i;
    }
    if (xp > 0) v.push_back(make_pair(i, xp));
  }
  if (x > 1) v.push_back(make_pair(x, 1));
}
int main() {
  cin >> n >> k;
  decomp(k);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    for (int j = 0; j < ((int)(v).size()); j++) {
      int u = v[j].first;
      while (x % u == 0) {
        acc[i][j]++;
        x /= u;
      }
    }
  }
  for (int i = 0; i < ((int)(v).size()); i++) cnt[i] = acc[0][i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < ((int)(v).size()); j++) {
      while (cnt[j] < v[j].second && r[j] < n - 1) {
        r[j]++;
        cnt[j] += acc[r[j]][j];
      }
    }
    bool ok = true;
    long long maior = i;
    for (int j = 0; j < ((int)(v).size()); j++) maior = max(maior, r[j]);
    for (int j = 0; j < ((int)(v).size()); j++)
      while (r[j] < maior) {
        r[j]++;
        cnt[j] += acc[r[j]][j];
      }
    for (int j = 0; j < ((int)(v).size()); j++)
      if (cnt[j] < v[j].second) ok = false;
    if (ok)
      ans += n - maior;
    else
      break;
    for (int j = 0; j < ((int)(v).size()); j++) cnt[j] -= acc[i][j];
  }
  cout << ans << endl;
}
