#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const int mod = 1e9 + 7;
bool check(long long x, long long y) {
  if (x % y == 0) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int l = -1, r = 0;
  long long cur = 1, ans = 0;
  for (int i = 0; i < n; i++) {
    cur = cur * a[i];
    cur %= k;
    if (!cur) {
      r = i;
      long long curr = 1;
      while (true) {
        curr = curr * a[r];
        curr %= k;
        if (!curr) break;
        r--;
        cur = curr;
      }
      ans += (r - l) * (n - i);
      l = r;
    }
  }
  cout << ans << endl;
}
