#include <bits/stdc++.h>
using namespace std;
int a[9];
int main() {
  a[0] = 6;
  a[1] = 2;
  a[2] = 5;
  a[3] = 5;
  a[4] = 4;
  a[5] = 5;
  a[6] = 6;
  a[7] = 3;
  a[8] = 7;
  a[9] = 6;
  int n, m;
  cin >> n >> m;
  int sum = 0;
  for (int i = n; i <= m; i++) {
    int num = i;
    while (num > 0) {
      int d = num % 10;
      num /= 10;
      sum += a[d];
    }
  }
  cout << sum;
  return 0;
}
