/*
1. Vsota stevk vseh lihih stevil od 0-10 = 25 - 1 + 3 + 5 + 7 + 9
2. Vsota stevk vseh lihih stevil od 10-100 = 450 = 5 * 45 + 9 * 25 = (5 * 1 + 5 * 2 + ... + 5 * 9) + 9 * stevke lihe (0-10)
3. Vsota stevk vseh lihih stevil od 0-100 = 475 

Vsota stevk vseh lihih stevil od 100-1000 = 6525 = 50 * 45 + 9 * 475

*/
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
#define ull unsigned long long

unsigned long long izracun(int st) {
	unsigned long long rez = 0;
	int temp;
	st = (st + 1) / 2; //toliko je lihih stevk-

	//obravnava enic
	temp = st;
	rez += ((ull)temp / (ull)5) * (ull)25;
	//rez = sestevanje_stringov(rez, to_string(temp / 5 * 25));
	temp %= 5;
	rez += (ull)temp*temp; //vsota aritmetičnega zaporedja = n(2a1 + (n-1)*2)/2 = n(1 + n-1) = n*n
	//rez = sestevanje_stringov(rez, to_string(temp*temp));

	for (int i = 5; i > 0; i *= 10) {
		temp = st;
		rez += (ull)temp / (10 * (ull)i) * ((ull)i * 45);
		//rez = sestevanje_stringov(rez, to_string(temp / (10 * i) * (i * 45)));
		temp %= 10 * i;
		for (int j = 0; j < 9; j++) {
			rez += (ull) min(temp, i) * j;
			//rez = sestevanje_stringov(rez, to_string(min(temp, i) * j));
			temp -= i;
			if (temp <= 0) break;
		}
	}

	return rez;
}

int main() {
	int mmin, mmax;
	cin >> mmin >> mmax;
	cout <<izracun(mmax) - izracun(mmin - 1);

	return 0;
}