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