#include <bits/stdc++.h>
using namespace std;
const long long mx = 1e6;
long long dp[mx];
long long solve(long long x) {
  if (x < 10) return x;
  long long ans = x / 10 + 9, res = x;
  while (res >= 10) res /= 10;
  if (res > x % 10) ans--;
  return ans;
}
int main() {
  long long l, r;
  cin >> l >> r;
  l--;
  cout << solve(r) - solve(l) << endl;
}
