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