#include <bits/stdc++.h>
using namespace std;
const long long LINF = LLONG_MAX;
const int INF = INT_MAX;
const int MOD = 1e9 + 7;
const int N = 1e5 + 111;
int n, k;
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cin >> n >> k;
  if (k & 1) {
    cout << 1 + (k - 1) / 2;
  } else {
    cout << 1 + (n - k) / 2;
  }
}
