#include <bits/stdc++.h>
using namespace std;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
  cin.exceptions(ios::failbit);
}
class tmK {
 private:
  long long K;

 public:
  explicit tmK(long long K) : K(K) {}
  long long operator()(long long a, long long b) const { return a * b % K; }
};
template <typename T, typename Op>
class SegTree {
  T identity;
  Op op;
  std::vector<T> nodes;

 public:
  explicit SegTree(std::size_t n, const T &identity, const Op &op)
      : identity(identity), op(op), nodes(2 * n, this->identity) {
    for (int i = n - 1; i > 0; i--)
      nodes[i] = this->op(nodes[2 * i], nodes[2 * i + 1]);
  }
  template <typename Iterator>
  SegTree(Iterator first, Iterator last, const T &identity, const Op &op)
      : identity(identity), op(op) {
    std::size_t n = std::distance(first, last);
    nodes.reserve(2 * n);
    nodes.resize(n, this->identity);
    nodes.insert(nodes.end(), first, last);
    for (int i = n - 1; i > 0; i--)
      nodes[i] = this->op(nodes[2 * i], nodes[2 * i + 1]);
  }
  std::size_t size() const { return nodes.size() / 2; }
  void set(std::size_t idx, T value) {
    assert(0 <= idx && idx < size());
    idx += size();
    nodes[idx] = std::move(value);
    while (idx > 0) {
      idx /= 2;
      nodes[idx] = op(nodes[2 * idx], nodes[2 * idx + 1]);
    }
  }
  const T &operator[](std::size_t idx) const {
    assert(0 <= idx && idx < size());
    return nodes[idx + size()];
  }
  T query(std::size_t a, std::size_t b) const {
    assert(0 <= a && a <= size());
    assert(0 <= b && b <= size());
    a += size();
    b += size();
    T left = identity, right = identity;
    while (a < b) {
      if (a & 1) left = op(left, nodes[a++]);
      if (b & 1) right = op(nodes[--b], right);
      a /= 2;
      b /= 2;
    }
    return op(left, right);
  }
};
static void solve() {
  int N;
  long long K;
  cin >> N >> K;
  vector<long long> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    a[i] %= K;
  }
  SegTree<long long, tmK> seg(begin(a), end(a), 1LL, tmK(K));
  int R = 0;
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    if (R < i) R = i;
    while (R < N && seg.query(i, R + 1) != 0) R++;
    ans += N - R;
  }
  cout << ans << '\n';
}
int main(int argc, const char **argv) {
  redirect(argc, argv);
  solve();
  return 0;
}
