#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void smax(T &x, T y) {
  x = max((x), (y));
}
template <class T>
inline void smin(T &x, T y) {
  x = min((x), (y));
}
const int MOD = 1e9 + 7;
const int SIZE = 1e5 + 10;
const int INF = 0x3f3f3f3f;
int a, b;
int mp[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int countseg(int x) {
  int ret = 0;
  while (x) {
    ret += mp[x % 10];
    x /= 10;
  }
  return ret;
}
int main() {
  if (0) {
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  }
  while (scanf("%d%d", &(a), &(b)) == 2) {
    long long ans = 0;
    for (int i = (a); i < (b + 1); ++i) ans += countseg(i);
    printf("%I64d\n", ans);
  }
  return 0;
}
