#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  int arr[n];
  a = a - 1;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int ind1 = a, ind2 = a;
  int count = 0;
  if (arr[ind1] == 1) {
    count += 1;
  }
  ind1--;
  ind2++;
  while (ind1 >= 0 || ind2 < n) {
    if (ind1 >= 0 and ind2 < n) {
      if (arr[ind1] == 1 && arr[ind2] == 1) {
        count += 2;
      }
      ind1--;
      ind2++;
    } else if (ind1 >= 0) {
      if (arr[ind1] == 1) {
        count++;
      }
      ind1--;
    } else if (ind2 < n) {
      if (arr[ind2] == 1) {
        count++;
      }
      ind2++;
    }
  }
  cout << count << endl;
  return 0;
}
