#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int inf = (int)1e9;
const int maxn = 110;
long long f(long long x) {
  if (x < 10) return x;
  long long y = (x - 10) / 10;
  long long m = x;
  while (m >= 10) m /= 10;
  return y + (x % 10 >= m ? 1 : 0) + 9;
}
int main() {
  long long l, r;
  scanf(
      "%lld"
      "%lld",
      &l, &r);
  long long ans = f(r) - f(l - 1);
  printf(
      "%lld"
      "\n",
      ans);
  return 0;
}
