#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, counter = 0;
  cin >> a >> b;
  c = a;
  for (; a <= b; a++) {
    int x = a;
    while (x > 0) {
      if (x % 10 == 0) {
        counter += 6;
      }
      if (x % 10 == 1) {
        counter += 2;
      }
      if (x % 10 == 2) {
        counter += 5;
      }
      if (x % 10 == 3) {
        counter += 5;
      }
      if (x % 10 == 4) {
        counter += 4;
      }
      if (x % 10 == 5) {
        counter += 5;
      }
      if (x % 10 == 6) {
        counter += 6;
      }
      if (x % 10 == 7) {
        counter += 3;
      }
      if (x % 10 == 8) {
        counter += 7;
      }
      if (x % 10 == 9) {
        counter += 6;
      }
      x /= 10;
    }
  }
  cout << counter;
}
