#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000");
using namespace std;
const long double eps = 1e-9;
const long double pi = 3.141592653589793238;
struct point {
  point() {}
  point(long double a, long double b) : x(a), y(b) {}
  long double x, y;
  const bool operator<(const point p) const {
    return (x < p.x) || (abs(x - p.x) < eps && y < p.y);
  }
  const bool operator==(const point p) const {
    return abs(x - p.x) < eps && abs(y - p.y) < eps;
  }
};
struct vec {
  vec() {}
  vec(long double a, long double b) : x(a), y(b) {}
  vec(point a, point b) : x(b.x - a.x), y(b.y - a.y) {}
  long double x, y;
  long double operator*(vec v) { return x * v.x + y * v.y; }
  long double operator^(vec v) { return x * v.y - y * v.x; }
  long double len() { return sqrt(x * x + y * y); }
  void normalize() {
    long double l = this->len();
    x /= l;
    y /= l;
  }
};
struct line {
  line() {}
  line(long double x, long double y, long double z) : a(x), b(y), c(z) {}
  line(point& p1, point& p2) {
    a = p1.y - p2.y;
    b = p2.x - p1.x;
    c = p2.y * (p1.x - p2.x) + p2.x * (p2.y - p1.y);
  }
  long double a, b, c;
};
struct circle {
  circle() {}
  circle(point a, long double b) : p(a), r(b) {}
  point p;
  long double r;
};
long double len2(const point& a, const point& b) {
  return ((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
point intersect(line l1, line l2) {
  point p;
  p.y = (l1.a * l2.c - l2.a * l1.c) / (l2.a * l1.b - l1.a * l2.b);
  p.x = (l1.b * l2.c - l2.b * l1.c) / (l1.a * l2.b - l2.a * l1.b);
  return p;
}
bool center(point a, point b, point c, point& p) {
  if (abs(vec(a, b) ^ vec(a, c)) < eps) return false;
  line l1 = line(a, b);
  line l2 = line(a, c);
  point c1((a.x + b.x) / 2, (a.y + b.y) / 2);
  point c2((a.x + c.x) / 2, (a.y + c.y) / 2);
  point q1(c1.x + l1.a, c1.y + l1.b);
  point q2(c2.x + l2.a, c2.y + l2.b);
  p = intersect(line(c1, q1), line(c2, q2));
  return true;
}
bool was[4000][4000];
int a[1000000];
int x[1000000];
int n;
int k;
int ans = 0;
void dfs(int u, int v, int r) {
  if (was[u][v]) return;
  was[u][v] = true;
  ans++;
  if (r == 0 || v >= n) return;
  if (a[u] > 0 && x[v] > 0) dfs(v + 1, v + 2, r - 1);
  if (a[u] > 0 && x[v] < 100) dfs(u, v + 1, r - 1);
  if (a[u] != 100 && x[v] > 0) dfs(v, v + 1, r - 1);
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < 4000; i++)
    for (int j = 0; j < 4000; j++) was[i][j] = false;
  x[n] = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = n - 1; i >= 0; i--) x[i] = max(a[i], x[i + 1]);
  dfs(0, 1, k);
  cout << ans;
  return 0;
}
