#include <bits/stdc++.h>
using namespace std;
int s[1000030];
int main() {
  int n, a;
  while (scanf("%d%d", &n, &a) != EOF) {
    for (int i = 2; i <= n; i += 2) s[i] = n - i + 1;
    int res;
    if (a % 2 == 0)
      res = s[a] / 2 + 1;
    else
      res = a / 2 + 1;
    printf("%d\n", res);
  }
}
