#include <bits/stdc++.h>
using namespace std;
inline int read_int() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') {
      w = -1;
    }
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * w;
}
int main() {
  int n = read_int();
  int a = read_int();
  if (a & 1) {
    cout << (a + 1) / 2;
  } else {
    cout << (n + 2 - a) / 2;
  }
  return 0;
}
