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