#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x = 1;
  cin >> n >> m;
  if (m % 2 == 0) {
    for (int i = n; i >= 2; i -= 2) {
      if (i == m) {
        cout << x;
        return 0;
      }
      x++;
    }
  }
  if (m % 2 != 0) {
    for (int i = 1; i <= n; i += 2) {
      if (i == m) {
        cout << x;
        return 0;
      }
      x++;
    }
  }
}
