#include <bits/stdc++.h>
using namespace std;
int total(int);
int main(void) {
  int a, b, sum = 0;
  cin >> a >> b;
  for (int i = a; i <= b; ++i) sum += total(i);
  cout << sum << endl;
  return 0;
}
int total(int n) {
  int sum = 0;
  while (n != 0) {
    int temp = n % 10;
    n /= 10;
    switch (temp) {
      case 0:
      case 6:
      case 9:
        sum += 6;
        break;
      case 2:
      case 3:
      case 5:
        sum += 5;
        break;
      case 4:
        sum += 4;
        break;
      case 1:
        sum += 2;
        break;
      case 7:
        sum += 3;
        break;
      case 8:
        sum += 7;
        break;
    }
  }
  return sum;
}
