#include <bits/stdc++.h>
using namespace std;
using lli = long long;
using ld = long double;
mt19937 rnd(time(nullptr));
vector<lli> num;
vector<vector<vector<vector<lli>>>> dp;
lli GetResult(lli pos, lli first, lli last, lli f) {
  if (pos == num.size()) {
    if ((first != 0) && (first == last))
      return 1;
    else
      return 0;
  }
  if (dp[pos][first][last][f] != -1) return dp[pos][first][last][f];
  lli res = 0;
  lli LMT = (f == 0 ? num[pos] : 9);
  for (lli dgt = 0; dgt <= LMT; dgt++) {
    lli nf = f;
    if (f == 0 && dgt < LMT) nf = 1;
    if (first != 0) {
      res += GetResult(pos + 1, first, dgt, nf);
    } else {
      if (dgt != 0)
        res += GetResult(pos + 1, dgt, dgt, nf);
      else
        res += GetResult(pos + 1, first, dgt, nf);
    }
  }
  return (dp[pos][first][last][f] = res);
}
lli CalcDp(lli b) {
  num.clear();
  while (b > 0) {
    num.push_back(b % 10);
    b /= 10;
  }
  reverse(num.begin(), num.end());
  dp.assign(20, vector<vector<vector<lli>>>(
                    10, vector<vector<lli>>(10, vector<lli>(2, -1))));
  lli res = GetResult(0, 0, 0, 0);
  return res;
}
inline void Solve() {
  lli l = 0, r = 0;
  cin >> l >> r;
  cout << CalcDp(r) - CalcDp(l - 1);
}
signed main() {
  cout << fixed << setprecision(20);
  Solve();
  return 0;
}
