#include <bits/stdc++.h>
using namespace std;
long long l, r;
bool check(long long k) {
  int fd = k % 10;
  while (k >= 10) k /= 10;
  return fd == k;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> l >> r;
  long long res = 0;
  if (r - l <= 1234) {
    for (long long i = l; i <= r; i++) res += check(i);
    cout << res;
  } else {
    while (r % 10 != 0) {
      res += check(r);
      r--;
    }
    while (l % 10 != 0) {
      res += check(l);
      l++;
    }
    res += (r - l) / 10;
    cout << res;
  }
}
