#include <bits/stdc++.h>
using namespace std;
int main() {
  int segment[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  int ans[1000001] = {0};
  int i;
  int gewei, shiwei, baiwei, qianwei, wanwei, shiwanwei;
  for (i = 0; i <= 9; i++) ans[i] = segment[i];
  for (i = 10; i <= 99; i++) {
    shiwei = i / 10;
    gewei = i % 10;
    ans[i] = segment[shiwei] + segment[gewei];
  }
  for (i = 100; i <= 999; i++) {
    baiwei = i / 100;
    shiwei = (i - baiwei * 100) / 10;
    gewei = i % 10;
    ans[i] = segment[baiwei] + segment[shiwei] + segment[gewei];
  }
  for (i = 1000; i <= 9999; i++) {
    qianwei = i / 1000;
    baiwei = (i - qianwei * 1000) / 100;
    shiwei = (i - qianwei * 1000 - baiwei * 100) / 10;
    gewei = i % 10;
    ans[i] =
        segment[qianwei] + segment[baiwei] + segment[shiwei] + segment[gewei];
  }
  for (i = 10000; i <= 99999; i++) {
    wanwei = i / 10000;
    qianwei = (i - wanwei * 10000) / 1000;
    baiwei = (i - wanwei * 10000 - qianwei * 1000) / 100;
    shiwei = (i - wanwei * 10000 - qianwei * 1000 - baiwei * 100) / 10;
    gewei = i % 10;
    ans[i] = segment[wanwei] + segment[qianwei] + segment[baiwei] +
             segment[shiwei] + segment[gewei];
  }
  for (i = 100000; i <= 999999; i++) {
    shiwanwei = i / 100000;
    wanwei = (i - shiwanwei * 100000) / 10000;
    qianwei = (i - shiwanwei * 100000 - wanwei * 10000) / 1000;
    baiwei = (i - shiwanwei * 100000 - wanwei * 10000 - qianwei * 1000) / 100;
    shiwei = (i - shiwanwei * 100000 - wanwei * 10000 - qianwei * 1000 -
              baiwei * 100) /
             10;
    gewei = i % 10;
    ans[i] = segment[shiwanwei] + segment[wanwei] + segment[qianwei] +
             segment[baiwei] + segment[shiwei] + segment[gewei];
  }
  ans[1000000] = segment[1] + 6 * segment[0];
  int a, b;
  int maxans = 0;
  cin >> a >> b;
  for (i = a; i <= b; i++) maxans = maxans + ans[i];
  cout << maxans << endl;
}
