#include <bits/stdc++.h>
using namespace std;
long long int pw(long long int a, long long int b, long long int mod) {
  if (!b) return 1;
  if (b & 1) return a * pw(a * a % mod, b / 2, mod) % mod;
  return pw(a * a % mod, b / 2, mod) % mod;
}
const long long int MAXN = 3e3 + 10;
const long long int INF = 8e18;
const long long int MOD = 1e9 + 7;
int n, k, dist[MAXN][MAXN], mark[MAXN][MAXN], p[MAXN], ps[MAXN], ans;
queue<pair<int, int> > q;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
  }
  if (n == 1) return cout << 1 << '\n', 0;
  ;
  for (int i = n; i >= 1; i--) {
    ps[i] = 50;
    if (ps[i + 1] == 100 || p[i] == 100) ps[i] = 100;
    if (ps[i + 1] == 0 && p[i] == 0) ps[i] = 0;
  }
  for (int i = 0; i < MAXN; i++) fill(dist[i], dist[i] + MAXN, int(1e9));
  dist[1][2] = 0;
  q.push({1, 2});
  while (!q.empty()) {
    int a, b;
    tie(a, b) = q.front();
    q.pop();
    if (mark[a][b]) continue;
    mark[a][b] = 1;
    if (dist[a][b] == k || b > n) continue;
    for (int i = 0; i < 2; i++) {
      if (i == 0 && ps[b] == 100) continue;
      if (i == 1 && ps[b] == 0) continue;
      for (int j = 0; j < 2; j++) {
        if (j == 0 && p[a] == 100) continue;
        if (j == 1 && p[a] == 0) continue;
        int c = (i == 0 ? a : (j == 0 ? b : b + 1));
        int d = (j == 0 ? (i == 0 ? b : b + 1) : (i == 0 ? b + 1 : b + 2));
        if (dist[c][d] <= dist[a][b] + 1) continue;
        dist[c][d] = dist[a][b] + 1;
        q.push({c, d});
      }
    }
  }
  for (int i = 0; i < MAXN; i++) {
    for (int j = 0; j < MAXN; j++) {
      ans += mark[i][j];
    }
  }
  cout << ans << '\n';
  return 0;
}
