#include <bits/stdc++.h>
using namespace std;
long long p10[20], a, b;
long long doit(long long n) {
  if (n < 10) return n;
  long long ret = 0;
  ret = 9;
  long long now = 10;
  int pow = 0;
  while (n > now) {
    for (int i = 1; i < 10; i++) {
      long long ti = i * now + i;
      if (n < ti) break;
      if (n >= ti + now - 10)
        ret += p10[pow];
      else {
        ret += (n - ti) / 10 + 1;
        break;
      }
    }
    now *= 10;
    pow++;
  }
  return ret;
}
int main() {
  p10[0] = 1;
  for (int i = 1; i < 18; i++) p10[i] = p10[i - 1] * 10;
  scanf("%I64d%I64d", &a, &b);
  printf("%I64d\n", doit(b) - doit(a - 1));
}
