#include using namespace std; int Digits[10]; long long Sum[10], Cnt[10]; long long calc(int e) { long long nows = 0; for(int i = 0; i < 10; ++i) { Digits[i] = e % 10; e /= 10; } long long ret = 0; for(int i = 9; i >= 1; --i) { for(int j = 0; j < Digits[i]; ++j) { ret += (nows + j) * Cnt[i] + Sum[i]; } nows += Digits[i]; } for(int j = 1; j < Digits[0]; j += 2) ret += nows + j; return ret; } long long calc2(int e) { long long ret = 0; for(int i = 1; i < e; i += 2) { for(int j = i; j; j /= 10) ret += j % 10; } return ret; } int main() { Cnt[0] = 1LL; Cnt[1] = 5LL; Sum[1] = 1 + 3 + 5 + 7 + 9; for(int i = 2; i < 10; ++i) { Cnt[i] = Cnt[i - 1] * 10LL; Sum[i] = Sum[i - 1] * 10LL + 45LL * Cnt[i - 1]; } long long a, b; cin >> a >> b; cout << calc(b + 1) - calc(a); return 0; }