#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  ios_base::sync_with_stdio(0);
  ;
  long long n, m, a = 0, l, r, temp;
  string s;
  cin >> n >> m;
  n--;
  if (m < 10)
    r = m;
  else {
    temp = m;
    r = (m / 10) + 9;
    while (m / 10) m /= 10;
    if (temp % 10 < m) r--;
  }
  if (n < 10)
    l = n;
  else {
    temp = n;
    l = (n / 10) + 9;
    while (n / 10) n /= 10;
    if (temp % 10 < n) l--;
  }
  cout << r - l << endl;
  return 0;
}
