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