#include <bits/stdc++.h>
using namespace std;
long long xar[20];
long long l, r, ans1, ans2, si, m1, k, a[1111], xx, d, i;
int main() {
  xar[0] = 1;
  for (i = 1; i <= 18; i++) xar[i] = xar[i - 1] * 10;
  cin >> l >> r;
  l--;
  if (l < 10)
    ans1 = l;
  else {
    k = 0;
    m1 = l;
    while (m1 > 0) {
      m1 /= 10;
      k++;
    }
    si = k;
    m1 = l;
    while (m1 > 0) {
      k--;
      a[k] = m1 % 10;
      m1 /= 10;
    }
    xx = 0;
    for (i = 1; i < si - 1; i++) xx = (xx * 10) + a[i];
    if (a[si - 1] >= a[0]) ans1++;
    ans1 += xx;
    ans1 += (a[0] - 1) * xar[si - 2];
    ans1 += 9;
    for (i = 1; i < si - 1; i++) ans1 += 9 * xar[i - 1];
  }
  l = r;
  if (l < 10)
    ans2 = l;
  else {
    k = 0;
    m1 = l;
    while (m1 > 0) {
      m1 /= 10;
      k++;
    }
    si = k;
    m1 = l;
    while (m1 > 0) {
      k--;
      a[k] = m1 % 10;
      m1 /= 10;
    }
    xx = 0;
    for (i = 1; i < si - 1; i++) xx = (xx * 10) + a[i];
    if (a[si - 1] >= a[0]) ans2++;
    ans2 += xx;
    ans2 += (a[0] - 1) * xar[si - 2];
    ans2 += 9;
    for (i = 1; i < si - 1; i++) ans2 += 9 * xar[i - 1];
  }
  cout << ans2 - ans1 << endl;
}
