#include <bits/stdc++.h>
using namespace std;
long long bigmod(long long b, long long p, long long md) {
  if (p == 0) return 1;
  if (p % 2 == 1) {
    return ((b % md) * bigmod(b, p - 1, md)) % md;
  } else {
    long long y = bigmod(b, p / 2, md);
    return (y * y) % md;
  }
}
vector<long long> num;
long long dp[20][10][10][2];
long long call(long long pos, long long first_digit, long long last_digit,
               long long tight) {
  if (pos == num.size()) {
    if (first_digit == last_digit)
      return 1;
    else
      return 0;
  }
  if (dp[pos][first_digit][last_digit][tight] != -1) {
    return dp[pos][first_digit][last_digit][tight];
  }
  long long lmt = tight ? 9 : num[pos];
  long long cnt = 0;
  for (long long i = 0; i <= lmt; i++) {
    long long curr_first = first_digit;
    if (pos == 0) curr_first = i;
    if (first_digit == 0 && i) curr_first = i;
    long long new_tight = tight;
    if (i < num[pos]) new_tight = 1;
    cnt += call(pos + 1, curr_first, i, new_tight);
  }
  dp[pos][first_digit][last_digit][tight] = cnt;
  return cnt;
}
long long solve(long long n) {
  num.clear();
  while (n) {
    num.push_back(n % 10);
    n = n / 10;
  }
  reverse(num.begin(), num.end());
  memset(dp, -1, sizeof(dp));
  long long res = call(0, 0, 0, 0);
  return res;
}
int main() {
  long long a, b;
  cin >> a >> b;
  long long res = solve(b) - solve(a - 1);
  cout << res << endl;
  return 0;
}
