#include <bits/stdc++.h>
using namespace std;
bool arr[101];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, a;
  cin >> n >> a;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
  }
  int ans = arr[a];
  for (int d = 1; d < n; ++d) {
    int left = a - d;
    int right = a + d;
    if ((left >= 1 and arr[left]) and (right <= n and arr[right])) {
      ans += 2;
    } else if (left < 1 and right <= n) {
      ans += arr[right];
    } else if (right > n and left >= 1) {
      ans += arr[left];
    }
  }
  cout << ans << endl;
  return 0;
}
