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