#include <bits/stdc++.h>
using namespace std;
int a[1000001];
int n, m, k, i, j;
int main() {
  cin >> n >> m;
  if (m % 2 == 1)
    cout << (m + 1) / 2;
  else {
    for (i = 2; i <= n; i += 2) a[i] = n - i + 2;
    cout << a[m] / 2;
  }
}
