#include <bits/stdc++.h>
int main() {
  int a, b, i, p, x = 0;
  scanf("%d%d", &a, &b);
  p = a;
  while (p <= b) {
    while (p != 0) {
      i = p % 10;
      p = p / 10;
      switch (i) {
        case 0:
          x += 6;
          break;
        case 1:
          x += 2;
          break;
        case 2:
          x += 5;
          break;
        case 3:
          x += 5;
          break;
        case 4:
          x += 4;
          break;
        case 5:
          x += 5;
          break;
        case 6:
          x += 6;
          break;
        case 7:
          x += 3;
          break;
        case 8:
          x += 7;
          break;
        case 9:
          x += 6;
          break;
      }
    }
    a++;
    p = a;
  }
  printf("%d", x);
}
