#include <bits/stdc++.h>
using namespace std;
int a, b, ret;
map<int, int> mp;
int calc(int n) {
  int ret = 0;
  while (n) {
    ret += mp[n % 10];
    n /= 10;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  mp[0] = 6;
  mp[1] = 2;
  mp[2] = 5;
  mp[3] = 5;
  mp[4] = 4;
  mp[5] = 5;
  mp[6] = 6;
  mp[7] = 3;
  mp[8] = 7;
  mp[9] = 6;
  cin >> a >> b;
  for (int i = a; i <= b; i++) ret += calc(i);
  cout << ret << endl;
  return 0;
}
