#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, temp1, temp2;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  int cnt = 0;
  if (arr[k - 1] == 1) {
    ++cnt;
  }
  int z = max(k - 1, n - k);
  for (int i = 1; i <= z; ++i) {
    temp1 = k - i - 1, temp2 = k - 1 + i;
    if (temp1 >= 0 && temp2 < n) {
      if (arr[temp1] == 1 && arr[temp2] == 1) {
        cnt += 2;
      }
    } else if (temp1 >= 0 && arr[temp1] == 1) {
      ++cnt;
    } else if (temp2 < n && arr[temp2] == 1) {
      ++cnt;
    }
  }
  cout << cnt << "\n";
  return 0;
}
