#include <bits/stdc++.h>
using namespace std;
int N, K;
int dp[3010][3010];
int P[3000], mx[3000];
int only[3010], none;
int main() {
  scanf("%d%d", &N, &K);
  for (int(i) = 0; (i) < (N); (i)++) scanf("%d", &P[i]);
  mx[N - 1] = P[N - 1];
  for (int i = N - 2; i >= 0; i--) mx[i] = max(mx[i + 1], P[i]);
  if (N == 1) {
    puts("1");
    return 0;
  }
  for (int(i) = 0; (i) < (N); (i)++)
    for (int(j) = 0; (j) < (N); (j)++) dp[i][j] = (1 << 27);
  for (int(i) = 0; (i) < (N); (i)++) only[i] = (1 << 27);
  none = (1 << 27);
  dp[0][1] = 0;
  for (int(i) = 0; (i) < (N); (i)++)
    for (int(j) = (i + 1); (j) < (N); (j)++)
      if (dp[i][j] < (1 << 27)) {
        if (P[i] && mx[j]) {
          if (j + 1 >= N)
            none = min(none, dp[i][j] + 1);
          else if (j + 2 >= N)
            only[j + 1] = min(only[j + 1], dp[i][j] + 1);
          else
            dp[j + 1][j + 2] = min(dp[j + 1][j + 2], dp[i][j] + 1);
        }
        if (mx[j] < 100 && P[i] > 0) {
          if (j + 1 >= N)
            only[i] = min(only[i], dp[i][j] + 1);
          else
            dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + 1);
        }
        if (mx[j] > 0 && P[i] < 100) {
          if (j + 1 >= N)
            only[j] = min(only[j], dp[i][j] + 1);
          else
            dp[j][j + 1] = min(dp[j][j + 1], dp[i][j] + 1);
        }
      }
  int res = 0;
  for (int(i) = 0; (i) < (N); (i)++)
    for (int(j) = 0; (j) < (N); (j)++)
      if (dp[i][j] <= K) res++;
  for (int(i) = 0; (i) < (N); (i)++)
    if (only[i] <= K) res++;
  if (none <= K) res++;
  printf("%d\n", res);
}
