#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, a;
  cin >> n >> a;
  for (int i = 1; i <= n; i += 2)
    if (i == a || (n - i + 1) == a) {
      cout << (i - 1) / 2 + 1;
      return 0;
    }
}
