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