#include <bits/stdc++.h>
const long long mod = (long long)1e9 + 7;
const int maxn = (int)1e6 + 2;
long long inf = 1LL << 60;
const double eps = 1e-9;
double pi = 3.14159265359;
using namespace std;
template <class N>
inline void read(N &n) {
  N x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  n = x * f;
}
int main() {
  int n, a;
  cin >> n >> a;
  if (a % 2)
    cout << (a / 2) + 1;
  else
    cout << (n / 2) - (a / 2) + 1;
  return 0;
}
