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