#include <bits/stdc++.h>
using namespace std;
inline int value(int x) {
  switch (x) {
    case 0:
      return 6;
    case 1:
      return 2;
    case 2:
      return 5;
    case 3:
      return 5;
    case 4:
      return 4;
    case 5:
      return 5;
    case 6:
      return 6;
    case 7:
      return 3;
    case 8:
      return 7;
    case 9:
      return 6;
  }
}
inline int sum(int x) {
  int val = 0;
  while (x > 0) {
    val += value(x % 10);
    x = x / 10;
  }
  return val;
}
int main() {
  int a, b;
  cin >> a >> b;
  int ans = 0;
  while (a <= b) {
    ans += sum(a);
    a++;
  }
  cout << ans << "\n";
}
