#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 3e3 + 9;
const int INF = 1e9 + 10;
int vec[MAX_N];
int dp[MAX_N][MAX_N];
int t[MAX_N];
int s[MAX_N];
int main() {
  int N, M, T;
  while (~scanf("%d%d", &N, &M)) {
    for (int i = 0; i < MAX_N; i++) fill(dp[i], dp[i] + MAX_N, INF);
    memset(t, 0, sizeof(t));
    memset(s, 0, sizeof(s));
    for (int i = 1; i <= N; i++) {
      scanf("%d", &vec[i]);
    }
    int temp = 0;
    for (int i = N; i >= 1; i--) {
      if (vec[i] == 100) temp = 1;
      if (temp == 1) t[i] = 1;
      s[i] = s[i + 1] + vec[i];
    }
    dp[1][2] = 0;
    for (int i = 1; i <= N; i++) {
      for (int j = i + 1; j <= N; j++) {
        if (s[j] > 0 && vec[i] < 100)
          dp[j][j + 1] = min(dp[j][j + 1], dp[i][j] + 1);
        if (t[j] < 1 && vec[i] > 0)
          dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + 1);
        if (vec[i] > 0 && s[j] > 0)
          dp[j + 1][j + 2] = min(dp[j + 1][j + 2], dp[i][j] + 1);
      }
    }
    int ans = 0;
    for (int i = 1; i <= N + 1; i++) {
      for (int j = i + 1; j <= N + 2; j++) {
        if (dp[i][j] <= M) ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
