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