#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e) {
  cout << e << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
template <class T>
T f_min(T a, T b) {
  if (a > b)
    return b;
  else
    return a;
}
template <class T>
T f_max(T a, T b) {
  if (a > b)
    return a;
  else
    return b;
}
template <class T>
inline T sqr(T n) {
  return n * n;
}
template <class T>
T Abs(T x) {
  return (x > 0) ? x : -x;
}
template <class T>
inline double LOG(T a, T b) {
  return (log(a) / log(b));
}
template <class T>
T power(T B, T P) {
  return (P == 0) ? 1 : B * (power(B, (P - 1)));
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
T BigMod(T B, T P, T M) {
  if (P == 0)
    return 1;
  else if (P % 2 == 0)
    return sqr((BigMod(B, P / 2, M))) % M;
  else
    return (B % M) * (BigMod(B, P - 1, M)) % M;
}
template <class T>
T LCM(T a, T b) {
  if (a < 0) return LCM(-a, b);
  if (b < 0) return LCM(a, -b);
  return (a * (b / GCD(a, b)));
}
long long dp[20][12][12];
long long rec(int len, int dig, int cur) {
  if (!len) {
    if (cur == dig) return 1;
    return 0;
  }
  long long &ret = dp[len][dig][cur];
  if (ret != -1) return ret;
  ret = 0;
  int i;
  for (i = 0; i <= 9; i++) ret += rec(len - 1, dig, i);
  return ret;
}
long long calc(long long a) {
  string str;
  stringstream ss;
  ss << a;
  ss >> str;
  int len = (int)str.size();
  int i, j;
  long long ans = 0;
  for (i = 1; i < len; i++) {
    for (j = 1; j < 10; j++) ans += rec(i - 1, j, j);
  }
  for (i = 1; i < str[0] - '0'; i++) ans += rec(len - 1, i, i);
  for (i = 1; i < len; i++) {
    for (j = 0; j < str[i] - '0'; j++) {
      ans += rec(len - i - 1, str[0] - '0', j);
    }
  }
  return ans;
}
int main(void) {
  long long a, b;
  scanf("%I64d %I64d", &a, &b);
  memset(dp, -1, sizeof(dp));
  long long resA = calc(a) + 1;
  long long resB = calc(b + 1) + 1;
  long long res = resB - resA;
  printf("%I64d\n", res);
  return 0;
}
