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