#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e8;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
int n, y, z, arr[1000] = {0};
int main() {
  cin >> n >> y;
  for (int x = 0; x < (int)(n); ++x) {
    cin >> arr[x];
  }
  if (arr[y - 1] == 1) {
    z++;
  };
  if ((n - y) < (y - 1)) {
    for (int i = (y - 1); i < (int)(n); ++i) {
      if (arr[i] == 1 && arr[(y - 1) - (i - (y - 1))] == 1 && i != (y - 1)) {
        z++;
        z++;
      }
    }
    for (int i = 0; i < (int)(y - (n - y) - 1); ++i) {
      if (arr[i] == 1) {
        z++;
      }
    }
  } else if ((n - y) > (y - 1)) {
    for (int i = 0; i < (int)(y - 1); ++i) {
      if (arr[i] == 1 && arr[(y - 1) + ((y - 1) - i)] == 1) {
        z++;
        z++;
      }
    }
    for (int i = (((y - 1) * 2) + 1); i < (int)(n); ++i) {
      if (arr[i] == 1) {
        z++;
      }
    }
  } else {
    for (int i = 0; i < (int)(y - 1); ++i) {
      if (arr[i] == 1 && arr[(y - 1) + ((y - 1) - i)] == 1) {
        z++;
        z++;
      }
    }
  }
  cout << z;
  return 0;
}
