#include <bits/stdc++.h>
using namespace std;
int spf[100001];
long long int solve(long long int x) {
  long long int ans = 0, f, e, xx = x;
  if (x < 10) return x;
  e = x % 10;
  while (x) {
    f = x % 10;
    x /= 10;
  }
  if (f <= e)
    ans = 9 + xx / 10;
  else
    ans = 8 + xx / 10;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int r, l;
  cin >> l >> r;
  cout << solve(r) - solve(l - 1) << "\n";
  return 0;
}
