#include <bits/stdc++.h>
using namespace std;
int dp[3010][3010];
int p[3010];
int up[3010];
int down[3010];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
  int MAX = p[n], MIN = p[n];
  for (int i = n; i >= 1; i--) {
    MAX = max(MAX, p[i]);
    MIN = min(MIN, p[i]);
    up[i] = MAX;
    down[i] = MIN;
  }
  for (int i = 1; i <= n + 5; i++) {
    for (int j = 1; j <= n + 5; j++) {
      dp[i][j] = 1e6 + 7;
    }
  }
  dp[1][2] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      if (p[i] != 100 && up[j] != 0) {
        dp[j][j + 1] = min(dp[j][j + 1], dp[i][j] + 1);
      }
      if (p[i] != 0 && up[j] != 100) {
        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + 1);
      }
      if (p[i] != 0 && up[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; j <= n + 2; j++) {
      if (dp[i][j] <= k) {
        ans++;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
