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