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