#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, count, i;
  cin >> n >> a;
  if (a % 2 == 1) {
    i = 1;
    count = 1;
    while (i < a) {
      i += 2;
      count++;
    }
  } else {
    if (n % 2 == 0)
      count = 1;
    else
      count = 2;
    i = n;
    while (i > a) {
      i = i - 2;
      count++;
    }
  }
  cout << count;
}
