#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e+5;
int fin(long long n) {
  while (n > 9) n /= 10;
  return n;
}
int main() {
  long long l, r, ansr = 0, cmp = 0, ansl = 0, ans;
  cin >> l >> r;
  if (l > 9) {
    ansl = l / 10;
    ansr = r / 10;
    if (r % 10 >= fin(r)) ansr++;
    if (l % 10 >= fin(l)) ansl++;
    if (l % 10 == fin(l))
      return cout << ansr - ansl + 1 << endl, 0;
    else
      return cout << ansr - ansl << endl, 0;
  } else {
    if (r <= 9) return cout << r - l + 1 << endl, 0;
    r--;
    ans = 9 - l + 1;
    ans += r / 10;
    cout << ans << endl;
  }
}
