#include <bits/stdc++.h>
using namespace std;
int arr[105];
int main() {
  int n, i, left_, right_, cnt = 0, m;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  cnt += arr[m - 1];
  left_ = m - 2;
  right_ = m;
  while (1) {
    if (left_ < 0 && right_ >= n) break;
    if (left_ >= 0 && right_ < n) {
      if (arr[left_] == 1 && arr[right_] == 1) cnt += 2;
    } else if (left_ < 0) {
      cnt += arr[right_];
    } else
      cnt += arr[left_];
    left_--;
    right_++;
  }
  cout << cnt << endl;
  return 0;
}
