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