#include <bits/stdc++.h>
using namespace std;
const int N = 2000006;
long long dp[22][11][2][2];
long long l, r;
string str;
string gen(long long n) {
  string s;
  while (n > 0) {
    long long r = n % 10;
    s += char(r + '0');
    n /= 10;
  }
  while (s.size() < 20) s += "0";
  reverse(s.begin(), s.end());
  return s;
}
long long call(long long pos, long long first, long long nisi, long long f) {
  long long E = str[pos] - '0';
  if (pos == str.size() - 1) {
    if (f == 0) {
      return (nisi == 1);
    } else {
      if (nisi == 1)
        return first <= E;
      else
        return 0;
    }
  }
  if (dp[pos][first][nisi][f] != -1) return dp[pos][first][nisi][f];
  long long ret = 0;
  long long ed = str[pos] - '0';
  if (f == 0) ed = 9;
  for (long long i = 0; i <= ed; i++) {
    long long newfirst = first;
    if (nisi == 0 and i > 0) newfirst = i;
    ret += call(pos + 1, newfirst, nisi || (i != 0), f && (i == ed));
  }
  return dp[pos][first][nisi][f] = ret;
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> l >> r;
  str = gen(r);
  long long ans = call(0, 0, 0, 1);
  str = gen(l - 1);
  memset(dp, -1, sizeof(dp));
  ans = ans - call(0, 0, 0, 1);
  for (long long i = max(1LL, l); i <= min(9LL, r); i++) ans++;
  cout << ans << "\n";
}
