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