#include <bits/stdc++.h>
using namespace std;
const int N = 500100;
const int M = 2000100;
const long long mod = 1e9 + 7;
long long solve(long long p) {
  if (p < 10) return p;
  long long ans = p / 10 + 9, k = p % 10;
  while (p >= 10) p /= 10;
  if (p > k) ans--;
  return ans;
}
int main() {
  long long l, r;
  cin >> l >> r;
  cout << solve(r) - solve(l - 1) << endl;
  return 0;
}
