#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  vector<int> odd, even;
  for (int i = 1; i <= n; i++) {
    if (i & 1)
      odd.push_back(i);
    else
      even.push_back(i);
  }
  if (k & 1) {
    int x = lower_bound(odd.begin(), odd.end(), k) - odd.begin();
    cout << x + 1 << endl;
  } else {
    int x = lower_bound(even.begin(), even.end(), k) - even.begin();
    cout << even.size() - x << endl;
  }
  return 0;
}
