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