//Code by Patcas Csaba

#include <vector>
#include <string> 
#include <set> 
#include <map> 
#include <queue> 
#include <bitset> 
#include <stack>
#include <list>

#include <numeric> 
#include <algorithm> 

#include <cstdio>
#include <fstream>
#include <iostream> 
#include <sstream> 
#include <iomanip>

#include <cctype>
#include <cmath> 
#include <ctime>
#include <cassert>

using namespace std;

#define LL long long
#define PII pair <int, int>
#define VB vector <bool>
#define VI vector <int>
#define VD vector <double>
#define VS vector <string>
#define VPII vector <pair <int, int> >
#define VVI vector < VI >
#define VVB vector < VB >

#define FORN(i, n) for(int i = 0; i < (n); ++i)
#define FOR(i, a, b) for(int i = (a); i <= (b); ++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define REPEAT do{ 
#define UNTIL(x) }while(!(x)); 

#define SZ size()
#define BG begin() 
#define EN end() 
#define CL clear()
#define X first
#define Y second
#define RS resize
#define PB push_back
#define MP make_pair
#define ALL(x) x.begin(), x.end()

#define IN_FILE "a.in"
#define OUT_FILE "a.out"

int n, m;

LL f(int x)
{
  if (x <= 0) return 0;
  vector<LL> count(10);
  int pow10 = 1;
  int numberEnd = 0;
  while (x)
  {
    for(int digit = 1; digit <= 9; digit += 1)
    {
      if (pow10 == 1 && !(digit & 1)) continue;
      count[digit] += (LL)(x / (pow10 * 10)) * ((pow10 == 1) ? 1 : (pow10 / 2));
    }
    for(int digit = 1; digit < (x % 10); digit += 1)
    {
      if (pow10 == 1 && !(digit & 1)) continue;
      count[digit] += ((pow10 == 1) ? 1 : (pow10 / 2));
    }
    if ((pow10 == 1) && ((x % 10) & 1) || pow10 > 1) 
    {
      count[x % 10] += (pow10 == 1) ? 1 : ((numberEnd + 1) / 2);
    }
    numberEnd = (x % 10) * pow10 + numberEnd;
    pow10 *= 10;
    x /= 10;
  }

  LL sum = 0;
  FOR(i, 0, 9) sum += (LL)i * count[i];
  return sum;
}

int main()
{
	//Read data
	//freopen(IN_FILE, "r", stdin);
	//freopen(OUT_FILE, "w", stdout);
  
  cin >> n >> m;
  cout << f(m) - f(n - ((n & 1) ? 2 : 1)) << endl;

	return 0;
}