#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, a, otv = 1, zp = 1;
  cin >> n >> a;
  int mas[2][n / 2];
  for (int i = 0; i < n / 2; i++) {
    mas[0][i] = zp;
    zp += 2;
  }
  zp = 2;
  for (int i = (n / 2) - 1; i >= 0; i--) {
    mas[1][i] = zp;
    zp += 2;
  }
  for (int i = 0; i < n / 2; i++) {
    if ((mas[0][i] == a) || (mas[1][i] == a)) {
      cout << otv + i;
      break;
    }
  }
}
