#include <iostream>
using namespace std;
int main()
{
int YEAR_A, YEAR_B;
while (cin >> YEAR_A >> YEAR_B)
{
int YEAR_AMOUNT = 0;
if (YEAR_A > 1752 && YEAR_B >= YEAR_A && YEAR_B <= 10000)
{
for (int YEAR_CHECK = YEAR_A; YEAR_CHECK <= YEAR_B; YEAR_CHECK++)
{
if (YEAR_CHECK % 400 == 0 || (YEAR_CHECK % 4 == 0 && YEAR_CHECK % 100 != 0))
{
YEAR_AMOUNT++;
}
}
cout << YEAR_AMOUNT << endl;
}
}
}