#include <bits/stdc++.h>
int main() {
  long long i, a, b, sum, suma, sumb, t, temp, leap;
  while (scanf("%I64d%I64d", &a, &b) != -1) {
    sum = 0;
    suma = 0;
    sumb = 0;
    leap = 0;
    if (a < 10)
      suma = a, leap++;
    else {
      t = a % 10;
      temp = a;
      while (a > 10) {
        a = a / 10;
      }
      if (t >= a) {
        suma = temp / 10 + 9;
        if (t == a) leap++;
      } else
        suma = temp / 10 + 8;
    }
    if (b < 10)
      sumb = b;
    else {
      t = b % 10;
      temp = b;
      while (b >= 10) {
        b = b / 10;
      }
      if (t >= b) {
        sumb = temp / 10 + 9;
      } else
        sumb = temp / 10 + 8;
    }
    sum = sumb - suma + leap;
    printf("%I64d\n", sum);
  }
  return 0;
}
