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