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