#include <bits/stdc++.h>
using namespace std;
long long gao(long long num) {
  if (num < 10) return num;
  long long t = num;
  int head = 0;
  while (num) {
    head = num % 10;
    num /= 10;
  }
  long long ans = 0;
  if (head <= t % 10)
    ans = t / 10 + 9;
  else
    ans = t / 10 + 9 - 1;
  return ans;
}
int main() {
  long long l, r;
  scanf("%I64d%I64d", &l, &r);
  printf("%I64d\n", gao(r) - gao(l - 1));
  return 0;
}
