#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a;
  cin >> n >> a;
  if (a % 2) {
    cout << (a + 1) / 2 << endl;
    return 0;
  }
  cout << (n / 2 + 1 - a / 2) << endl;
  return 0;
}
