#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, dis, a[105], ans = 0, i, j;
  cin >> n >> dis;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (a[dis] == 1) ans++;
  i = dis - 1;
  j = dis + 1;
  while (i >= 1 && j <= n) {
    if (a[i] == 1 && a[j] == 1) ans += 2;
    i--;
    j++;
  }
  if (i < 1) {
    while (j <= n) {
      if (a[j] == 1) ans++;
      j++;
    }
  }
  if (j > n) {
    while (i >= 1) {
      if (a[i] == 1) ans++;
      i--;
    }
  }
  cout << ans << endl;
}
