#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, a;
  cin >> n >> a;
  if ((a & 1) == 0) {
    int x{2};
    n -= 1;
    while (x != a) {
      x += 2;
      n -= 2;
    }
  } else {
    n = a;
  }
  int ct{};
  for (int i{1}; i <= n; i += 2) ct++;
  cout << ct;
  return 0;
}
