#include <bits/stdc++.h>
const long double EPS = 1e-9;
const int MOD = (int)1e9 + 7;
const int INF32 = (int)1e9;
const int INF64 = (long long)1e19;
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  if ((a & 1) == 0) a = n + 2 - a;
  cout << ceil(a / 2.0) << endl;
}
