#include <bits/stdc++.h>
using namespace std;
int compare(const void* x1, const void* x2) { return (*(int*)x1 - *(int*)x2); }
int main() {
  int n, a;
  cin >> n >> a;
  int k = n / 2;
  if (a % 2 == 1)
    cout << a / 2 + 1;
  else
    cout << (k - a / 2 + 1);
  return 0;
}
