#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, n;
  cin >> n >> a;
  int q[n], w[n];
  for (int i = 0; i < n / 2; i++) {
    q[i] = i * 2 + 1;
    w[i] = n - 2 * i;
  }
  for (int i = 0; i < n / 2; i++) {
    if (q[i] == a or w[i] == a) {
      cout << i + 1;
      break;
    }
  }
}
