#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
long long int mark[32000];
vector<long long int> v;
void seive() {
  long long int i, j;
  for (i = 3; i < 32000; i += 2) {
    if (mark[i] == 0) {
      for (j = i + i; j < 32000; j += i) mark[j] = 1;
    }
  }
  v.push_back(2);
  for (i = 3; i < 32000; i += 2)
    if (mark[i] == 0) v.push_back(i);
}
vector<pair<long long int, long long int> > factor(long long int n) {
  long long int i;
  vector<pair<long long int, long long int> > v1;
  for (i = 0; i < v.size() && v[i] <= sqrt(n); i++) {
    long long int cn = 0;
    while (n % v[i] == 0) {
      n /= v[i];
      cn++;
    }
    if (cn > 0) v1.push_back(make_pair(v[i], cn));
  }
  if (n != 1) v1.push_back(make_pair(n, 1));
  return v1;
}
long long int a[100005], b[50][100005], b1[50][100005];
void cal(vector<pair<long long int, long long int> > v, long long int n) {
  long long int i, j;
  for (i = 0; i < v.size(); i++) {
    long long int p = v[i].first;
    for (j = 1; j <= n; j++) {
      while (a[j] % p == 0) {
        a[j] /= p;
        b[i][j]++;
      }
      b[i][j] += b[i][j - 1];
    }
  }
  for (i = 0; i < v.size(); i++) {
    for (j = 1; j <= n; j++) {
      long long int lo = j, hi = n, mid, ans = -1;
      while (lo <= hi) {
        mid = (lo + hi) >> 1;
        long long int p = b[i][mid] - b[i][j - 1];
        if (p < v[i].second)
          lo = mid + 1;
        else {
          ans = mid;
          hi = mid - 1;
        }
      }
      b1[i][j] = ans;
    }
  }
}
int main() {
  long long int n, k, i, j;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  seive();
  while (cin >> n >> k) {
    for (long long int i = 1; i < n + 1; i++) cin >> a[i];
    if (k == 1) {
      cout << (n * (n + 1)) / 2 << endl;
      continue;
    }
    vector<pair<long long int, long long int> > v = factor(k);
    cal(v, n);
    long long int ans = 0;
    for (i = 1; i <= n; i++) {
      long long int max1 = 0;
      bool f = 0;
      for (j = 0; j < v.size(); j++) {
        if (b1[j][i] == -1) f = 1;
        max1 = max(max1, b1[j][i]);
      }
      if (f == 1) break;
      ans += (n - max1 + 1);
    }
    cout << ans << endl;
  }
  return 0;
}
