#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int p;
  cin >> p;
  int c[n];
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  p--;
  int l = p;
  int r = n - p - 1;
  int b = 0;
  if (c[p]) {
    b++;
  }
  for (int i = 1; p + i < n && p - i >= 0; i++) {
    int s = c[p + i] + c[p - i];
    if (s == 2) {
      b += 2;
    }
  }
  if (r > l) {
    for (int i = p + l + 1; i < n; i++) {
      b += c[i];
    }
  } else if (l > r) {
    for (int i = p - r - 1; i >= 0; i--) {
      b += c[i];
    }
  }
  cout << b << endl;
  return 0;
}
