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