#include <bits/stdc++.h>
using namespace std;
int n, k;
int p[3010];
int step[3010];
int aft[3010];
int aft1[3010];
int ans[3010];
int main() {
  int i, j;
  while (scanf("%d %d", &n, &k) != EOF) {
    memset(ans, 0, sizeof(ans));
    memset(step, 0, sizeof(step));
    memset(aft, 0, sizeof(aft));
    memset(aft1, 0, sizeof(aft1));
    for (i = 0; i < n; i++) scanf("%d", p + i);
    for (i = n - 1; i >= 0; i--) {
      if (p[i + 1] == 100 || aft1[i + 1]) aft1[i] = 1;
      if (p[i + 1] || aft[i + 1]) aft[i] = 1;
    }
    step[0] = k;
    ans[0] = 1;
    for (i = 0; i < n; i++) {
      if (step[i]) {
        if (!p[i] || aft1[i]) {
          if (p[i]) {
            ans[i + 2] = 1;
            step[i + 2] = max(step[i + 2], step[i] - 1);
            if (p[i] != 100) {
              ans[i + 1] = 1;
              step[i + 1] = max(step[i + 1], step[i] - 1);
            }
          } else if (!p[i] && aft[i]) {
            ans[i + 1] = 1;
            step[i + 1] = max(step[i + 1], step[i] - 1);
          }
        } else {
          for (j = 1; j <= step[i] && i + j < n; j++) {
            ans[i]++;
            if (aft[i + j - 1]) {
              if (p[i] != 100) {
                ans[i + j] = 1;
                step[i + j] = max(step[i + j], step[i] - j);
              }
              ans[i + j + 1] = 1;
              step[i + j + 1] = max(step[i + j + 1], step[i] - j);
            }
          }
        }
      }
    }
    int sum = 0;
    for (i = 0; i <= n; i++) sum += ans[i];
    printf("%d\n", sum);
  }
  return 0;
}
