#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
const double PI = acos(-1.0);
const int EPS = (1e-10);
const int N = 1e5 * 2 + 10;
const int inf = 1e9 * 2 + 10;
const ll INF = 1e18 * 2 + 10;
const int MOD = 1e9 + 7;
int nxt() {
  int x;
  cin >> x;
  return x;
}
int fcmp(double a, double b) {
  return (fabs(a - b) < EPS ? 0 : a > b ? 1 : -1);
}
ll calc(ll x) {
  if (x < 10) return x;
  ll ans = x / 10 + 9, l = x % 10;
  while (x > 9) {
    x /= 10;
  }
  if (x > l) ans--;
  return ans;
}
ll l, r;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> l >> r;
  cout << calc(r) - calc(l - 1);
  return 0;
}
