#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, k, v[128];
  scanf("%d %d", &n, &k);
  k--;
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  int ans = v[k], i;
  for (i = 1; i <= n; i++) {
    if (k - i < 0 or k + i >= n) break;
    if (v[k - i] and v[k + i]) ans += 2;
  }
  for (; i <= n; i++) {
    if (k - i >= 0 and v[k - i]) ans++;
    if (k + i < n and v[k + i]) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
