#include <bits/stdc++.h>
using namespace std;
long long fun(long long x) {
  if (x < 10) return x;
  long long a, b, c;
  a = x % 10;
  b = x / 10;
  while (x) {
    c = x % 10;
    x /= 10;
  }
  if (c <= a) return b + 9;
  return b + 8;
}
int main() {
  long long a, b, c;
  cin >> a >> b;
  cout << fun(b) - fun(a - 1) << "\n";
  return 0;
}
