#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, d;
  cin >> n >> d;
  if (d & 1)
    cout << ((d - 1) / 2 + 1) << '\n';
  else {
    for (int i = 1; i <= n - 1; i += 2) {
      if (d == (n - i + 1)) return cout << ((i - 1) / 2 + 1) << '\n', 0;
    }
  }
  return 0;
}
