#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  vector<long long> A(100001);
  vector<long long> B(100001);
  vector<long long> C(100001);
  long long ans = 0;
  cin >> N >> M;
  B.at(0) = 0;
  for (int x = 0; x < (N); x++) {
    cin >> A.at(x + 1);
    B.at(x + 1) = B.at(x) + A.at(x + 1) % M;
    B.at(x + 1) = B.at(x + 1) % M;
  }
  for (int x = 0; x < (N); x++) {
    int n = 0;
    bool h = false;
    while (n < C.size()) {
      if (C.at(n) == B.at(x + 1)) {
        ans++;
        h = true;
      }
      n++;
    }
    C.push_back(B.at(x + 1));
  }
  cout << ans % 100 << endl;
  ;
}
