#include <bits/stdc++.h>
using namespace std;
int A[107];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
  }
  if (A[m] == 1) {
    ans++;
  }
  int a = 0, b = 0;
  for (int i = 1; i <= 100; i++) {
    if ((m - i) >= 1 && (i + m) <= n) {
      if (A[m - i] == 1 && A[m + i] == 1) {
        ans += 2;
      }
    } else {
      a = m - i;
      b = m + i;
      break;
    }
  }
  for (int i = 1; i <= a; i++) {
    if (A[i]) {
      ans++;
    }
  }
  for (int i = b; i <= n; i++) {
    if (A[i]) {
      ans++;
    }
  }
  printf("%d\n", ans);
}
