#include <bits/stdc++.h>
using namespace std;
int mostL, mostR, noD;
long long x, res, tenPowN;
long long fn(long long n) {
  res = 0;
  mostR = n % 10;
  noD = 1;
  tenPowN = 1;
  x = n;
  while (x > 9) {
    tenPowN *= 10;
    noD++;
    x /= 10;
  }
  if (noD == 1) return n;
  mostL = x;
  res = 9 * (1 - (1 - tenPowN) / 90);
  res += (mostL - 1) * tenPowN / 10;
  res += (n - mostL * tenPowN) / 10;
  if (mostL <= mostR) res++;
  return res;
}
int main() {
  long long l, r;
  cin >> l >> r;
  cout << fn(r) - fn(l - 1) << "\n";
  return 0;
}
