#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
void print() { cout << endl; }
void printarray() { return; }
void scan() { return; }
template <typename T, typename... Args>
void print(T a, Args... arg) {
  cout << a << " ";
  print(arg...);
}
template <typename T, typename... Args>
void scan(T &a, Args &...arg) {
  cin >> a;
  scan(arg...);
}
template <typename T, typename... Args>
void scan(vector<T> &v, Args &...arg) {
  for (auto &i : v) cin >> i;
  scan(arg...);
}
template <typename T, typename... Args>
void printarray(vector<T> &v, Args &...arg) {
  for (auto i : v) cout << i << " ";
  cout << endl;
  printarray(arg...);
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long int is_pallendrome(string s, long long int n) {
  long long int i = 0, j = n - 1;
  for (long long int i = 0; i < n / 2; i++, j--) {
    if (s[i] != s[j]) {
      return 0;
    }
  }
  return 1;
}
long long int binaryToDecimal(long long int n) {
  long long int num = n;
  long long int dec_value = 0;
  long long int base = 1;
  long long int temp = num;
  while (temp) {
    long long int last_digit = temp % 10;
    temp = temp / 10;
    dec_value += last_digit * base;
    base = base * 2;
  }
  return dec_value;
}
void decToBinary(long long int n) {
  for (long long int i = 31; i >= 0; i--) {
    long long int k = n >> i;
    if (k & 1)
      cout << "1";
    else
      cout << "0";
  }
}
long long int isvowel(char x) {
  if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') return 1;
  return 0;
}
long long int isconsonant(char x) {
  if (x != 'a' && x != 'e' && x != 'i' && x != 'o' && x != 'u') return 1;
  return 0;
}
long long int power(long long int x, unsigned long long int y) {
  if (y == 0) return 1;
  if (y % 2 == 0) return power(x, y / 2) * power(x, y / 2);
  return x * power(x, y / 2) * power(x, y / 2);
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
void solve() {
  long long int n, a, x = 0, cnt = 0;
  cin >> n >> a;
  if (a % 2 == 0)
    x = (n + 1) - a;
  else
    x = a;
  for (long long int i = 1; i <= n; i += 2) {
    cnt += 1;
    if (i == x) {
      break;
    }
  }
  print(cnt);
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
