#include <iostream>
using namespace std;

#define I int
#define LL long long

void count();

int main() {
	count();
	return 0;
}

void count() { //小红的正整数计数
	I l, r, t = 0;
	cin >> l >> r;
	t = (r - l + 1) % 2;
	if (t == 0)
		cout << (r - l + 1) / 2;
	else if (r % 2 == 0)
		cout << (r - l + 1) / 2 + 1;
	else
		cout << (r - l + 1) / 2;
}