#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int MAXN = 1e6 + 5;
long long a[30];
long long cnt;
long long dfs(long long pos) {
  if (pos == 1) {
    if (a[cnt] <= a[1])
      return 1;
    else
      return 0;
  }
  long long ans = 0;
  ans += a[pos] * pow(10, pos - 2);
  ans += dfs(pos - 1);
  return ans;
}
long long solve(long long x) {
  if (x == 0) return 1;
  cnt = 0;
  long long temp = x;
  while (temp) {
    cnt++;
    a[cnt] = temp % 10;
    temp /= 10;
  }
  long long ans = 0;
  if (cnt == 1) {
    return x + 1;
  }
  for (long long i = 1; i < cnt; i++) {
    if (i == 1)
      ans += 10;
    else
      ans += 9 * pow(10, i - 2);
  }
  for (long long i = 1; i < a[cnt]; i++) {
    ans += pow(10, cnt - 2);
  }
  ans += dfs(cnt - 1);
  return ans;
}
int main() {
  long long l, r;
  cin >> l >> r;
  cout << solve(r) - solve(l - 1) << endl;
}
