#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265358979323846;
const long double eps = 1e-16;
const unsigned long long mod = 1e9 + 7;
int main() {
  long long a, n;
  cin >> n >> a;
  if (a & 1) {
    cout << ((a + 1) >> 1);
  } else {
    cout << ((n >> 1) - (a >> 1) + 1);
  }
  return 0;
}
