#include <bits/stdc++.h>
const int MAX_N = (int)1e5 + 123;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;
using namespace std;
int main() {
  int n, id;
  cin >> n >> id;
  if (id % 2 == 1) {
    cout << id / 2 + 1 << endl;
  } else {
    cout << n / 2 - id / 2 + 1 << endl;
  }
  return 0;
}
