#include <bits/stdc++.h>
using namespace std;
long long l, r;
long long solve(long long cur) {
  if (cur < 10) return cur;
  long long ans = cur / 10 + 9;
  int lstD = cur % 10;
  while (cur > 9) cur /= 10;
  return ans - (lstD < cur);
}
int main() {
  cin >> l >> r;
  cout << solve(r) - solve(l - 1);
}
