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