#include <bits/stdc++.h>
int S[]{6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int a, b, s, i;
int main() {
  for (std::cin >> a >> b; a <= b; ++a)
    for (i = a; i; s += S[i % 10], i /= 10)
      ;
  std::cout << s;
}
