#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5);
long long f(long long x) {
  if (x < 10) return x;
  long long s = x / 10 + 9;
  long long last = x % 10;
  while (x >= 10) x /= 10;
  if (x > last) s--;
  return s;
}
void solve() {
  long long l, r;
  cin >> l >> r;
  cout << f(r) - f(l - 1) << '\n';
}
int main() {
  solve();
  return 0;
}
