#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int ans;
  if (k & 1) {
    ans = (k - 1) / 2 + 1;
  } else
    ans = (n - k) / 2 + 1;
  cout << ans << "\n";
}
