#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200;
const int MAXM = 200000;
const int INF = 1000000010;
const long long int MOD = 1000000007;
const long long int P = 31;
const double EPS = 1e-6;
int main() {
  ios_base::sync_with_stdio(false);
  int N, A;
  scanf("%d %d", &N, &A);
  if (A % 2 == 1) {
    printf("%d", (A + 1) / 2);
  } else {
    printf("%d", N / 2 - A / 2 + 1);
  }
  return 0;
}
