#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b;
  cin >> a >> b;
  stringstream ss, ss2;
  ss << a;
  ss2 << b;
  string s1 = ss.str();
  string s2 = ss2.str();
  long long ans = 0;
  long long ans1 = 0, ans2 = 0;
  for (int i = 1; i < s1.length(); i++) {
    ans1 += pow(10, max((long long)i - 2, 0ll)) * 9;
    cout << "";
  }
  for (int i = 1; i < s2.length(); i++) {
    ans2 += pow(10, max((long long)i - 2, 0ll)) * 9;
    cout << "";
  }
  for (int i = s1.length() - 2; i >= 0; i--) {
    long long p;
    if (i == 0)
      p = max(((long long)s1[i] - (long long)'0') - 1, 0ll);
    else
      p = max(((long long)s1[i] - (long long)'0'), 0ll);
    p *= pow(10, max((long long)s1.length() - i - 2, 0ll));
    ans1 += p;
    cout << "";
  }
  for (int i = s2.length() - 2; i >= 0; i--) {
    long long p;
    if (i == 0)
      p = max(((long long)s2[i] - (long long)'0') - 1, 0ll);
    else
      p = max(((long long)s2[i] - (long long)'0'), 0ll);
    p *= pow(10, max((long long)s2.length() - i - 2, 0ll));
    ans2 += p;
    cout << "";
  }
  if (((long long)s1[0] - (long long)'0') <
      ((long long)s1[s1.length() - 1] - (long long)'0'))
    ans1++;
  if (((long long)s2[0] - (long long)'0') <=
      ((long long)s2[s2.length() - 1] - (long long)'0'))
    ans2++;
  if (s1.length() == 1) ans1 = a - 1;
  if (s2.length() == 1) ans2 = b;
  ans = ans2 - ans1;
  cout << ans << endl;
  return 0;
}
