#include <bits/stdc++.h>
const int Maxn = 1e3 + 1, md = 1e9 + 7;
using namespace std;
int n, m;
int main() {
  cin >> n >> m;
  if (m & 1)
    cout << (m + 1) / 2;
  else
    cout << (n - m) / 2 + 1;
}
