#include<cstdio>
#include<cmath>
#define EPS 1e-8
typedef long long LL;
LL MAX(LL x, LL y) {
	return x > y ? x : y;
}
LL Gao(LL x) {
	LL temp, cnt, ans;
	if (x < 0)
		return 0;
	if (x < 4)
		return 1;
	cnt = temp = (LL) ((sqrt(1.0 + x) - 1) / 2 + EPS);
	//printf("cnt: %lld\n", cnt);
	temp *= 4;
	ans = (temp + 4) * cnt / 2 + cnt;
	//printf("ans: %lld\n", ans);
	return ans + 1 + MAX(x - ((cnt + 1) * cnt * 4 + (cnt + 1) * 4), 0);
}
int main() {
	LL a, b, ans;
	while (~scanf("%lld%lld", &a, &b)) {
		ans = Gao(b) - Gao(a - 1);
		printf("%lld\n", ans);
	}
	return 0;
}