#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  cin >> n >> k;
  if (k & 1) {
    cout << ((k + 1) >> 1) << endl;
  } else {
    cout << ((n - k + 2) >> 1) << endl;
  }
  return 0;
}
