#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s;
  scanf("%d %d", &n, &s);
  int dp[n + 1][s + 1];
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    int num;
    scanf("%d", &num);
    for (int j = s; j >= 0; j--) {
      int rightExtension = 0, leftExtension = 0;
      rightExtension = dp[i - 1][j] + 1;
      if (j - num >= 0) leftExtension = dp[i - 1][j - num];
      dp[i][j] = rightExtension + leftExtension;
    }
  }
  printf("%d\n", dp[n][s]);
  return 0;
}
