#include <bits/stdc++.h>
using namespace std;
int a[110];
int main() {
  int n, m, sum = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int low = m - 1;
  int high = n - m;
  int dis = 0;
  for (int i = 1; i <= n; i++) {
    int f, s;
    f = m - dis;
    s = m + dis;
    if (f == s) {
      if (a[f] == 1) sum++;
    } else if (f >= 1 && s <= n) {
      if (a[f] == 1 && a[s] == 1) sum += 2;
    } else if (f >= 1 && s > n) {
      if (a[f] == 1) sum++;
    } else if (f < 1 && s <= n) {
      if (a[s] == 1) sum++;
    }
    dis++;
  }
  cout << sum << endl;
  return 0;
}
