#include <bits/stdc++.h>
using namespace std;
int main() {
  int l, s;
  cin >> l >> s;
  int a[l + 1];
  int i, j;
  for (i = 1; i <= l; i++) cin >> a[i];
  int ctr = 0;
  for (i = 1; i <= l; i++)
    if (a[i] == s) ctr++;
  int coutn = 0;
  for (i = 1; i <= l; i++) {
    int sum = 0;
    for (j = 1; j <= i; j++) {
      sum += a[i];
      if (sum == s) {
        coutn++;
        sum = 0;
      }
    }
  }
  cout << ctr + coutn << "\n";
  return 0;
}
