#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
void solve() {
  long long n;
  cin >> n;
  ;
  long long a;
  cin >> a;
  ;
  if (a & 1) {
    cout << (a + 1) / 2 << endl;
  } else {
    long long x = a / 2 - 1;
    cout << n / 2 - x << endl;
  }
}
signed main() {
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  solve();
}
