#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  int l[n + 1], r[n + 1];
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 1)
      l[i] = i;
    else
      l[i] = n - i + 2;
  }
  for (int i = 1; i <= n; i++) {
    if (l[i] == a) {
      if (i % 2 == 1)
        cout << i / 2 + 1;
      else
        cout << i / 2;
      break;
    }
  }
}
