#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, j, l[50005], r[50005];
  cin >> n >> a;
  j = 0;
  for (int i = 0; i < n; i += 2) {
    l[j] = i + 1;
    r[j] = n - i;
    j++;
  }
  for (int i = 0; i < n / 2; i++) {
    if ((l[i] == a) || (r[i] == a)) {
      cout << i + 1 << endl;
      break;
    }
  }
  return 0;
}
