#include <bits/stdc++.h>
using namespace std;
long long solve(long long x) {
  long long ans = 0;
  long long fd, ld;
  ld = x % 10;
  long long temp = x;
  long long dc = 0;
  while (temp) {
    fd = temp % 10;
    temp /= 10;
    dc++;
  }
  if (dc <= 1) {
    return ld;
  }
  ans += (fd - 1) * pow(10, dc - 2);
  long long calc = x - fd * pow(10, dc - 1);
  calc /= 10;
  ans += calc;
  ans++;
  if (fd > ld) {
    ans--;
  }
  dc -= 1;
  while (dc >= 2) {
    ans += 9 * pow(10, dc - 2);
    dc--;
  }
  if (dc == 1) {
    ans += 9;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long r, l;
  cin >> l >> r;
  long long val1 = solve(r);
  long long val2 = solve(l - 1);
  cout << (val1 - val2);
  return 0;
}
