#include <bits/stdc++.h>
long long function(long long x) {
  int y = 0;
  long long i, result, first, summand = 9;
  if (x < 10) return x;
  for (first = x; first >= 10; first /= 10) y++;
  result = 9;
  for (i = 1; i < y; i++) {
    result += summand;
    summand *= 10;
  }
  summand /= 9;
  first = x / summand / 10;
  result += (first - 1) * summand;
  summand *= 10;
  result += (x - first * summand - first + 10) / 10;
  return result;
}
int main() {
  long long l, r, result = 0;
  scanf("%I64d%I64d", &l, &r);
  printf("%I64d\n", function(r) - function(l - 1));
  return 0;
}
