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