#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 5;
const int MOD = 1e9 + 7;
const int inf = 1e9 + 5;
long long dp[25][11][2];
vector<long long> dig;
long long dfs(long long len, long long fst, long long f) {
  if (len == 1) {
    if (!fst && !f) return 9;
    if (!fst && f) return dig[len];
    if (f) return fst <= dig[len];
    return 1;
  }
  if (dp[len][fst][f] != -1) return dp[len][fst][f];
  long long r = (f == 1) ? dig[len] : 9;
  long long ans = 0;
  for (int i = 0; i <= r; i++) {
    long long rn = (fst == 0) ? i : fst;
    ans += dfs(len - 1, rn, f & (i == dig[len]));
  }
  return dp[len][fst][f] = ans;
}
long long solve(long long num) {
  memset(&dp, -1, sizeof dp);
  dig.resize(25, 0);
  long long len = 0;
  while (num != 0) {
    dig[++len] = num % 10;
    num /= 10;
  }
  long long ans = dfs(len, 0, 1);
  dig.clear();
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long l, r;
  cin >> l >> r;
  cout << solve(r) - solve(l - 1);
  return 0;
}
