#include <bits/stdc++.h>
using namespace std;
string toString(int x) {
  vector<int> v;
  while (x > 0) {
    int lastDigit = x % 10;
    v.push_back(lastDigit);
    x /= 10;
  }
  string ans = "";
  while (v.size() > 0) {
    ans += (v.back() + '0');
    v.pop_back();
  }
  return ans;
}
int main() {
  int a, b, sum = 0;
  scanf("%d%d", &a, &b);
  for (int i = a; i <= b; i++) {
    string r = toString(i);
    for (int j = 0; j < r.length(); j++) {
      char c = r[j];
      if (c == '1') {
        sum = sum + 2;
      } else if (c == '7') {
        sum = sum + 3;
      } else if (c == '4') {
        sum = sum + 4;
      } else if (c == '2' || c == '3' || c == '5') {
        sum = sum + 5;
      } else if (c == '9' || c == '6' || c == '0') {
        sum = sum + 6;
      } else {
        sum = sum + 7;
      }
    }
  }
  printf("%d", sum);
  return 0;
}
