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