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