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