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