#include <bits/stdc++.h>
using namespace std;
long long int solve(long long int n) {
  long long int val = n, f, e, u = 0;
  if (val < 10) return val;
  e = val % 10;
  while (val > 0) {
    f = val % 10;
    val /= 10;
  }
  if (f > e)
    u = 8 + (n / 10);
  else
    u = 9 + (n / 10);
  return u;
}
int main() {
  long long int a, b;
  cin >> a >> b;
  long long int ans = solve(b) - solve(a - 1);
  cout << ans << endl;
}
