#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, a, count = 0, k, temp = 0, j;
  cin >> n >> a;
  int t[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> t[i];
  }
  i = a - 1;
  j = a + 1;
  if (t[a] == 1) count = 1;
  while (i >= 1 && j <= n) {
    if (t[i] * t[j] == 1) count = count + 2;
    i--;
    j++;
  }
  while (i >= 1) {
    count = count + t[i];
    i--;
  }
  while (j <= n) {
    count = count + t[j];
    j++;
  }
  printf("%d\n", count);
  return 0;
}
