#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  int n, a;
  cin >> n >> a;
  int ans = 1;
  if (a % 2) {
    int an = 1;
    while (an < a) {
      an += 2;
      ans++;
    }
  } else {
    while (n > a) {
      n -= 2;
      ans++;
    }
  }
  cout << ans << endl;
}
