#include <bits/stdc++.h>
using namespace std;
const int N = 3010;
int n, m, a[N], max_a[N];
int dis[N][N];
void bfs() {
  queue<pair<int, int> > Q;
  memset(dis, -1, sizeof(dis));
  Q.push(make_pair(1, 2));
  dis[1][2] = m;
  while (Q.size()) {
    int fst = Q.front().first, nxt = Q.front().second;
    Q.pop();
    if (dis[fst][nxt] == 0 or nxt > n) continue;
    if (max_a[nxt] != 0 and a[fst] != 100 and dis[nxt][nxt + 1] == -1)
      dis[nxt][nxt + 1] = dis[fst][nxt] - 1, Q.push(make_pair(nxt, nxt + 1));
    if (max_a[nxt] != 100 and a[fst] != 0 and dis[fst][nxt + 1] == -1)
      dis[fst][nxt + 1] = dis[fst][nxt] - 1, Q.push(make_pair(fst, nxt + 1));
    if (a[fst] != 0 and max_a[nxt] != 0 and dis[nxt + 1][nxt + 2] == -1)
      dis[nxt + 1][nxt + 2] = dis[fst][nxt] - 1,
                         Q.push(make_pair(nxt + 1, nxt + 2));
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  for (int i = n; i >= 1; --i) max_a[i] = max(a[i], max_a[i + 1]);
  bfs();
  int ans = (dis[n + 1][n + 2] != -1);
  for (int i = 1; i <= n; ++i)
    for (int j = i + 1; j <= n + 1; ++j) ans += (dis[i][j] != -1);
  cout << ans << endl;
  return 0;
}
