#include <bits/stdc++.h>
using namespace std;
long long int dp[10][19];
long long int f(long long int k) {
  if (k == 0) return 0;
  long long int n = k, i, j, kk = 0, ans = 0, ones = k % 10;
  string s = to_string(k);
  while (n > 0) {
    kk++;
    j = n;
    n /= 10;
  }
  if (j == 1) {
    ans = dp[9][kk - 1];
  } else
    ans = dp[j - 1][kk];
  if (j <= ones) {
    ans++;
  }
  for (i = 1; i < s.size() - 1; i++) {
    ans += ((s[i] - '0') * pow(10, (s.size() - i - 2)));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int i, j, k, n, m, ans, te = 0;
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (i = 1; i <= 9; i++) {
    dp[i][1] = 1;
  }
  for (i = 2; i < 19; i++) {
    for (j = 1; j <= 9; j++) dp[j][i] = pow(10, i - 2);
  }
  for (j = 1; j <= 18; j++) {
    for (i = 1; i <= 9; i++) {
      dp[i][j] += te;
      te = dp[i][j];
    }
  }
  cin >> n >> m;
  ans = f(m) - f(n - 1);
  cout << ans;
  return 0;
}
