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