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