#include#include long long a, b; long long solve(long long left) { if (left < 0) return 0; long long ans = 1, mid, right = 0, j = 1; while (left >= 10) { mid = left % 10; left /= 10; if (mid) ans += left * j; else ans += (left - 1) * j + right + 1; right = right + mid * j; j *= 10; } return ans; } int main() { while (~scanf("%lld%lld", &a, &b) && a != -1 || b != -1) { printf("%lld\n", solve(b) - solve(a - 1)); } return 0; }