#include <bits/stdc++.h>
using namespace std;
int t[105];
int main() {
  int n, a, d, result = 0;
  cin >> n >> a;
  for (int ii = 1; ii <= n; ii++) cin >> t[ii];
  d = max(n - a, a - 1);
  if (t[a] == 1) result += 1;
  for (int ii = 1; ii <= d; ii++) {
    if (ii + a <= n && a - ii > 0) {
      if (t[ii + a] * t[a - ii] == 1) result += 2;
    } else if (ii + a <= n && a - ii < 1) {
      if (t[ii + a] == 1) result += 1;
    } else if (ii + a > n && a - ii > 0) {
      if (t[a - ii] == 1) result += 1;
    }
  }
  cout << result << endl;
  return 0;
}
