#include <bits/stdc++.h>
using namespace std;
const int Max_N(105);
int N, A, Ans, is[Max_N], x, y;
int main() {
  scanf("%d%d", &N, &A);
  for (int i = 1; i <= N; ++i) scanf("%d", is + i);
  Ans = is[A];
  for (int i = 1; i <= N; ++i) {
    x = A + i, y = A - i;
    if (x <= N && y >= 1)
      if (is[x] && is[y]) Ans += 2;
    if (x <= N && y < 1) Ans += is[x];
    if (x > N && y >= 1) Ans += is[y];
  }
  printf("%d", Ans);
  return 0;
}
