#include <bits/stdc++.h>
using namespace std;
const int maxn = 3000 + 10;
const int INF = 0x3f3f3f3f;
int vis[maxn][maxn], p[maxn], mx[maxn];
int dp[maxn][maxn];
int n, k, ans;
void dfs(int a, int b, int t) {
  if (vis[a][b]) return;
  vis[a][b] = 1;
  ans++;
  if (t == k || b > n) return;
  if (p[a] != 0) {
    if (mx[b] != 0) dfs(b + 1, b + 2, t + 1);
    if (mx[b] != 100) dfs(a, b + 1, t + 1);
  }
  if (p[a] != 100) {
    if (mx[b] != 0) dfs(b, b + 1, t + 1);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
  }
  for (int i = n; i >= 1; i--) {
    mx[i] = max(mx[i + 1], p[i]);
  }
  memset(dp, INF, sizeof(dp));
  dp[1][2] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (mx[j] != 100 && p[i] != 0)
        dp[i][j + 1] = min(dp[i][j] + 1, dp[i][j + 1]);
      if (mx[j] != 0 && p[i] != 0)
        dp[j + 1][j + 2] = min(dp[i][j] + 1, dp[j + 1][j + 2]);
      if (mx[j] != 0 && p[i] != 100)
        dp[j][j + 1] = min(dp[i][j] + 1, dp[j][j + 1]);
    }
  }
  for (int i = 1; i <= n + 2; i++) {
    for (int j = i + 1; j <= n + 2; j++) {
      if (dp[i][j] <= k) ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
