#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
int A, N, res;
int cities[MAXN];
int main(void) {
  cin >> A >> N;
  for (int i = 1; i <= A; i++) {
    cin >> cities[i];
  }
  if (cities[N]) {
    res++;
  }
  int l = N - 1, r = N + 1;
  while (true) {
    if (l >= 1 && r <= A) {
      if ((cities[l] && cities[r])) {
        res += 2;
      }
      l--;
      r++;
    } else if (l >= 1) {
      if (cities[l]) {
        res++;
      }
      l--;
    } else if (r <= A) {
      if (cities[r]) {
        res++;
      }
      r++;
    }
    if (l < 1 && r > A) {
      break;
    }
  }
  cout << res << "\n";
}
