#include <bits/stdc++.h>
using namespace std;
long long int jj, a, n, i, j, k[100001], p[1000001], l, ii;
int main() {
  cin >> n >> a;
  ii = 1;
  jj = n;
  for (i = 1; i < n / 2 + 1; i++) k[i] = (ii += 2);
  for (i = 1; i < n / 2; i++) p[i] = (jj -= 2);
  if (a == 1 || a == n) {
    cout << 1 << endl;
    return 0;
  } else if (a % 2 == 0) {
    for (i = 1; i < n / 2 + 1; i++) {
      if (a == p[i]) {
        {
          cout << i + 1 << endl;
          return 0;
        }
      }
    }
  } else {
    for (i = 1; i < n / 2 + 1; i++) {
      if (a == k[i]) {
        {
          cout << i + 1 << endl;
          return 0;
        }
      }
    }
  }
}
