#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
inline long long power(long long a, long long n, long long m) {
  if (n == 0) return 1;
  long long p = power(a, n / 2, m);
  p = (p * p) % m;
  if (n % 2)
    return (p * a) % m;
  else
    return p;
}
const long long MOD = 998244353;
const int N = int(3e5) + 999;
vector<long long int> num;
long long int solve(long long int n) {
  num.clear();
  while (n != 0) {
    num.push_back(n % 10);
    n /= 10;
  }
  reverse(num.begin(), num.end());
  long long int len = num.size(), ans = 0;
  if (len == 1) {
    return num[0] - 1;
  }
  for (long long int i = 1; i <= len - 1; i++) {
    if (i <= 2)
      ans += 9;
    else
      ans += 9 * pow(10, i - 2);
  }
  for (long long int i = 0; i <= len - 2; i++) {
    ans += (num[i] - (i == 0)) * pow(10, len - i - 2);
  }
  if (num[0] < num[len - 1]) ans++;
  return ans;
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int l, r;
  cin >> l >> r;
  long long int ans = solve(r + 1) - solve(l);
  cout << ans;
}
