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