/*
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 long long

unsigned long long izracun(long long int st) {
	long long int rez = 0, temp;

	st = (st + 1) / 2;

	//obrbavnava 2
	temp = st;
	rez += (temp / 5) * 25;
	temp %= 5;
	rez += temp*temp;

	for (long long int i = 5; i <= 5000000000; i *= 10) {
		temp = st;
		rez += temp / (10 * i) * (45 * i);
		temp %= 10 * i;
		for (int j = 0; j < 10; j++) {
			rez += min(temp, i)*j;
			temp -= i;
			if (temp < 0) break;
		}
	}
	return rez;
}

int main() {
	int mmin, mmax;
	cin >> mmin >> mmax;
	//if (mmin % 2 == 1)mmin++;
	//if (mmax % 2 == 1) mmax--;
	cout <<(ull)(izracun(mmax) - izracun(mmin - 1));
	//cout <<endl<< izracun(mmax) << ' ' << izracun(mmin - 1);

	return 0;
}