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