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