#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  ;
  int n, i, a, x[101], ans, j;
  cin >> n >> a;
  for (i = 1; i <= n; i++) {
    cin >> x[i];
  }
  ans = 0;
  if (x[a] == 1) ans++;
  i = a - 1;
  j = a + 1;
  while (i >= 1 && j <= n) {
    if (x[i] == 1 && x[j] == 1) ans += 2;
    i--;
    j++;
  }
  while (i >= 1) {
    if (x[i] == 1) ans++;
    i--;
  }
  while (j <= n) {
    if (x[j] == 1) ans++;
    j++;
  }
  cout << ans;
  return 0;
}
