#include <bits/stdc++.h>
using namespace std;
long long Set(long long n, long long pos) { return n = n | (1LL << pos); }
long long reset(long long n, long long pos) { return n = n & ~(1LL << pos); }
bool check(long long n, long long pos) { return (bool)(n & (1LL << pos)); }
long long mul(long long a, long long b) {
  long long c;
  c = (a % 1000000007 * b % 1000000007) % 1000000007;
  return c;
}
long long add(long long a, long long b) {
  long long c;
  c = (a % 1000000007 + b % 1000000007) % 1000000007;
  return c;
}
long long sub(long long a, long long b) {
  long long c;
  c = ((a % 1000000007 - b % 1000000007) % 1000000007 + 1000000007) %
      1000000007;
  return c;
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long exgcd(long long x, long long y, long long &a, long long &b) {
  int flag = 0;
  long long t, la = 1, lb = 0, ra = 0, rb = 1;
  while (x % y) {
    if (flag == 0)
      la -= x / y * ra, lb -= x / y * rb;
    else
      ra -= x / y * la, rb -= x / y * lb;
    t = x, x = y, y = t % y;
    flag = 1 - flag;
  }
  if (flag == 0)
    a = ra, b = rb;
  else
    a = la, b = lb;
  return y;
}
long long l, r;
vector<long long> dig;
long long dp[25][11][11];
long long solve(long long pos, long long choto, long long frr) {
  long long &ret = dp[pos][choto][frr];
  if (ret != -1) return ret;
  if (pos == dig.size() - 1) {
    if (frr == 0)
      return ret = choto;
    else if (choto >= frr)
      return ret = 1;
    else
      return ret = 0;
  }
  ret = 0;
  for (long long i = 0; i <= choto; i++) {
    long long now_frr = frr;
    if (frr == 0) now_frr = i;
    ret += solve(pos + 1, 9, now_frr);
  }
  return ret;
}
long long calc(long long num) {
  dig.clear();
  for (long long i = 0; i <= 20; i++) {
    dig.push_back(num % 10);
    num /= 10;
  }
  reverse(dig.begin(), dig.end());
  long long is = 0;
  long long ans = 0;
  for (long long i = 0; i < dig.size(); i++) {
    if (dig[i] == 0)
      continue;
    else {
      ans += solve(i, dig[i] - 1, is);
      if (is == 0) is = dig[i];
    }
  }
  if (dig[dig.size() - 1] == is && is != 0) ans++;
  return ans;
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%lld", &l);
  scanf("%lld", &r);
  printf("%lld\n", calc(r) - calc(l - 1));
  return 0;
}
