#include <bits/stdc++.h>
using namespace std;
long long int x, y;
long long int gcd(long long int a, long long int b) {
  if (a == 0) {
    x = 0, y = 1;
    return b;
  }
  long long int gc = gcd(b % a, a);
  long long int temp;
  temp = x;
  x = y - (b / a) * temp;
  y = temp;
  return gc;
}
int second[100005];
vector<int> prime;
void sieve() {
  int i, j;
  prime.push_back(2);
  for (i = 3; i <= 32000; i += 2) {
    if (second[i] != -1) {
      prime.push_back(i);
      for (j = i * i; j <= 32000; j += 2 * i) {
        second[j] = -1;
      }
    }
  }
}
map<int, int> fk;
vector<pair<int, int> > ak[100005];
int a[100005];
map<int, int> cur;
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int i, j;
  sieve();
  int c;
  j = k;
  int fc = 0;
  for (i = 0; i < prime.size(); i++) {
    if (j % prime[i] == 0) {
      c = 0;
      while (j % prime[i] == 0) {
        c++;
        j /= prime[i];
      }
      fc++;
      fk[prime[i]] = c;
    }
    if (j == 1) break;
  }
  if (j != 1) {
    fc++;
    fk[j] = 1;
  }
  for (int t = 0; t < n; t++) {
    cin >> a[t];
    j = a[t];
    for (i = 0; i < prime.size(); i++) {
      if (j % prime[i] == 0) {
        c = 0;
        while (j % prime[i] == 0) {
          c++;
          j /= prime[i];
        }
        ak[t].push_back(make_pair(prime[i], c));
      }
      if (j == 1) break;
    }
    if (j != 1) ak[t].push_back(make_pair(j, 1));
  }
  int prevs = -1;
  int start = 0;
  int tc = 0;
  long long int ans = 0;
  if (k == 1) {
    ans = n * 1LL * (n + 1);
    ans /= 2;
    cout << ans;
    return 0;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < ak[i].size(); j++) {
      if (fk[ak[i][j].first] != 0) {
        if (cur[ak[i][j].first] >= fk[ak[i][j].first]) {
          cur[ak[i][j].first] += ak[i][j].second;
        } else {
          cur[ak[i][j].first] += ak[i][j].second;
          if (cur[ak[i][j].first] >= fk[ak[i][j].first]) {
            tc++;
          }
        }
      } else {
        cur[ak[i][j].first] += ak[i][j].second;
      }
    }
    if (tc == fc) {
      while (tc == fc && start <= i) {
        for (j = 0; j < ak[start].size(); j++) {
          cur[ak[start][j].first] -= ak[start][j].second;
          if (fk[ak[start][j].first] != 0) {
            if (cur[ak[start][j].first] < fk[ak[start][j].first]) {
              tc--;
            }
          }
        }
        start++;
      }
      ans += ((start - prevs - 1) * 1LL * (n - i));
      prevs = start - 1;
    }
  }
  cout << ans << endl;
}
