#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
int n, m;
pair<int, int> p[111111];
int ans;
string s;
bool bl;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  int j = 1;
  int qq = n - 2;
  int ww = 0;
  int q = n - 1;
  int w = n;
  for (int i = 1; i <= n / 2; i++) {
    p[j] = make_pair(q - qq, w - ww);
    ww += 2;
    qq -= 2;
    j++;
  }
  for (int i = 1; i <= n / 2; i++) {
    ans++;
    if (p[i].first == m || p[i].second == m) break;
  }
  cout << ans;
  return 0;
}
