#include <bits/stdc++.h>
using namespace std;
char gnum[10000];
long long int getans(long long int num) {
  long long int cur = num, ans = 0;
  int i;
  int digs = 0;
  if (num <= 9) {
    return num;
  }
  while (cur) {
    gnum[digs++] = '0' + (cur % 10);
    cur /= 10;
  }
  gnum[digs] = 0;
  reverse(gnum, gnum + digs);
  long long int pwt[20];
  pwt[0] = pwt[1] = 1;
  for (i = 2; i < 20; i++) pwt[i] = pwt[i - 1] * 10;
  long long int cpow = 1;
  for (i = 1; i < digs; i++) {
    ans += 9 * cpow;
    if (i >= 2) cpow *= 10;
  }
  int x = strlen(gnum);
  for (i = 0; i + 1 < x; i++) {
    ans += (gnum[i] - '0' - (i == 0)) * pwt[x - 1 - i];
  }
  if (gnum[x - 1] >= gnum[0]) ans += 1;
  return ans;
}
int main() {
  long long int l, r;
  cin >> l >> r;
  cout << getans(r) - getans(l - 1) << endl;
  return 0;
}
