#include <iostream>
using namespace std;
int main()
{
    int m, n, a;
    while (cin >> n >> m)
    {
        a = m - n + 2;
        a = a / 2;
        if (n % 2 != 0 && m % 2 == 0)
            a++;
        cout << a << endl;
    }
    return 0;
}