#include <bits/stdc++.h>
using namespace std;
int main() {
  int c, l, x[100], sum = 0, temp;
  cin >> c >> l;
  l--;
  for (int i = 0; i < c; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < c; i++) {
    temp = abs(i - l);
    if (x[i] == 1)
      if (temp + l > c - 1 || l - temp < 0 || x[l + temp] == 1 && l > i ||
          l < i && x[l - temp] == 1 || i == l)
        sum++;
  }
  cout << sum;
  return 0;
}
