#include <bits/stdc++.h>
static char buff[(int)1e6 + 17];
static constexpr long long inf = (long long)1e9 + 7ll;
inline void config_io(const bool& __fastio) {
  if (__fastio) {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
  }
  if (!std::string("").empty()) {
    assert(
        freopen(""
                ".in",
                "r", stdin));
    assert(
        freopen(""
                ".out",
                "w", stdout));
  }
}
using namespace std;
const int maxn = (int)5e5 + 17;
int n, a;
int main() {
  config_io(false);
  scanf("%d %d", &n, &a);
  if (a & 1)
    printf("%d\n", (a + 1) / 2);
  else
    printf("%d\n", (n - a) / 2 + 1);
  return 0;
}
