#include <bits/stdc++.h>
using namespace std;
long long Solve2(long long left, long long right, int dig) {
  right++;
  return ((right - dig) - left + 9) / 10;
}
long long Solve(long long num) {
  if (num < 10) return num;
  long long pw = 1;
  while (pw <= num / 10) pw *= 10;
  int first = num / pw;
  ((void)0);
  ((void)0);
  ((void)0);
  long long res = (first - 1) * pw / 10;
  res += Solve(pw - 1);
  res += Solve2(first * pw, num, first);
  ((void)0);
  ((void)0);
  return res;
}
long long qleft, qright;
int main() {
  scanf("%I64d%I64d", &qleft, &qright);
  long long ans = Solve(qright) - Solve(qleft - 1);
  printf("%I64d\n", ans);
  return 0;
}
