#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename T>
using min_queue = priority_queue<T, vector<T>, greater<T>>;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int N, K;
  cin >> N >> K;
  int p[3030];
  for (int i = 0; i < N; i++) cin >> p[i];
  int res = 0;
  queue<tuple<int, int, int>> q;
  static bool seen[3030][3030];
  q.emplace(0, 1, 0);
  seen[0][1] = 1;
  int mx[3030]{};
  for (int i = N - 1; i >= 0; i--) mx[i] = max(mx[i + 1], p[i]);
  vector<pii> tmp;
  while (!q.empty()) {
    res++;
    auto [x, y, z] = q.front();
    q.pop();
    if (y >= N) continue;
    if (z >= K) continue;
    tmp.clear();
    tmp.emplace_back(x, y + 1);
    tmp.emplace_back(y, y + 1);
    tmp.emplace_back(y + 1, y + 2);
    int deadx = mx[y], deady = p[x];
    for (auto [x1, y1] : tmp) {
      if (x1 == x && deadx == 100) continue;
      if (x1 != x && deadx == 0) continue;
      if ((y1 == y || x1 == y) && deady == 100) continue;
      if ((y1 != y && x1 != y) && deady == 0) continue;
      if (!seen[x1][y1]) {
        seen[x1][y1] = 1;
        q.emplace(x1, y1, z + 1);
      }
    }
  }
  cout << res << '\n';
}
