#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
long long powmod(long long a, long long b) {
  if (!b) return 1;
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a;
    b >>= 1;
    a = a * a;
  }
  return ans;
}
int main() {
  long long l, r, ans = 0;
  cin >> l >> r;
  for (int i = 1; i <= 18; i++) {
    for (int j = 1; j <= 9; j++) {
      long long bot = max(l, j * powmod(10, i - 1));
      long long top = min(r, (j + 1) * powmod(10, i - 1) - 1);
      while (bot % 10 != j) bot++;
      while ((top + 10) % 10 != j) top--;
      if (top >= bot) ans += (top - bot) / 10 + 1;
    }
  }
  cout << ans;
}
