#include <bits/stdc++.h>
using namespace std;
long long solve(long long n) {
  int i, j, len = 0, a[25];
  while (n) {
    a[len++] = n % 10;
    n /= 10;
  }
  long long res = 0;
  for (i = 1; i < len; i++) {
    long long x = 9;
    for (j = 1; j < i - 1; j++) x *= 10;
    res += x;
  }
  for (i = len - 1; i >= 0; i--) {
    for (int d = (i == len - 1); d < a[i]; d++) {
      if (i == 0 && len > 1 && d != a[len - 1]) continue;
      long long x = 1;
      for (j = 0; j < i - 1; j++) x *= 10;
      res += x;
    }
  }
  if (a[0] == a[len - 1]) res++;
  return res;
}
int main() {
  long long n, m;
  while (~scanf("%I64d%I64d", &n, &m)) {
    printf("%I64d\n", solve(m) - solve(n - 1));
  }
  return 0;
}
