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