#include <bits/stdc++.h>
using namespace std;
const int INF = 2e4;
const double EPS = 1e-9;
const double PI = acos(-1.0);
template <class T>
int chmin(T &t, T f) {
  return (t > f) ? (t = f, 1) : 0;
}
template <class T>
int chmax(T &t, T f) {
  return (t < f) ? (t = f, 1) : 0;
}
inline int getint() {
  int a;
  return scanf("%d", &a) ? a : (fprintf(stderr, "trying to read\n"), -1);
}
inline double getdouble() {
  double a;
  return scanf("%lf", &a) ? a : (fprintf(stderr, "trying to read\n"), -1);
}
const int N = 6100;
int lo[N][N];
vector<int> a, s2, s1;
void myCode() {
  int n = getint(), m = getint();
  for (int i = (int)(0); i < (int)(n); i++) {
    int first = getint();
    if (first == 0)
      a.push_back(0);
    else if (first == 100)
      a.push_back(2);
    else
      a.push_back(1);
  }
  for (int i = (int)(0); i < (int)(2 * m - n + 10); i++) a.push_back(0);
  s2 = vector<int>(((int)(a).size()), 0);
  s2.back() = a.back() == 2;
  for (int i = (int)(((int)(s2).size()) - 1) - 1; i >= 0; --i)
    s2[i] = s2[i + 1] || (a[i] == 2);
  s1 = vector<int>(((int)(a).size()), 0);
  s1.back() = a.back() != 0;
  for (int i = (int)(((int)(s1).size()) - 1) - 1; i >= 0; --i)
    s1[i] = s1[i + 1] || (a[i] != 0);
  for (int i = (int)(0); i < (int)(2 * n + 2); i++)
    for (int j = (int)(0); j < (int)(2 * n + 2); j++) {
      lo[i][j] = INF;
    }
  lo[0][1] = 0;
  for (int i = (int)(0); i < (int)(n); i++)
    for (int j = (int)(i + 1); j < (int)(n); j++) {
      if (a[i] != 0 && s1[j] != 0) {
        chmin(lo[j + 1][j + 2], lo[i][j] + 1);
      }
      if (a[i] != 2 && s1[j] != 0) {
        chmin(lo[j][j + 1], lo[i][j] + 1);
      }
      if (a[i] != 0 && s2[j] == 0) {
        chmin(lo[i][j + 1], lo[i][j] + 1);
      }
    }
  int ret = 0;
  for (int i = (int)(0); i < (int)(n); i++)
    for (int j = (int)(i + 1); j < (int)(n + 1); j++)
      if (lo[i][j] <= m) ++ret;
  if (lo[n][n + 1] <= m) ++ret;
  printf("%d\n", ret);
}
int main() {
  myCode();
  return 0;
}
