#include <bits/stdc++.h>   using namespace std;   unsigned long long power(unsigned long long x, unsigned long long y) {     if (y == 0) return 1;     unsigned long long tmp = power(x, y / 2);     tmp *= tmp;     if (y % 2) tmp *= x;     return tmp;   }   unsigned long long get(unsigned long long n) {     if (n <= 9) return n;     unsigned long long cnt, temp, d = 0;     unsigned long long tmp = n;     while (tmp / 10) {       tmp /= 10;       d++;     }     stringstream s;     s << n;     string str = s.str();     unsigned long long x = str[0] -  0 ;     temp = power(10, d);     n -= (str[0] -  0 ) * temp;     n /= 10;     if (str[0] <= str[str.size() - 1])       cnt = n + 1;     else       cnt = n;     cnt += ((power(10, d - 1)) * (x - 1));     return cnt + get(power(10, d) - 1);   }   int main() {     unsigned long long l, r;     cin >> l >> r;     cout << get(r) - get(l - 1) << endl;   }   