620B.md (1181B)
1 Source: https://codeforces.com/problemset/problem/620/B 2 3 B. Grandfather Dovlet’s calculator 4 5 time limit per test 6 7 1 second 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 standard input 16 17 output 18 19 standard output 20 21 Once Max found an electronic calculator from his grandfather Dovlet's chest. He noticed that the numbers were written with seven-segment indicators (<https://en.wikipedia.org/wiki/Seven-segment_display>). 22 23  24 25 Max starts to type all the values from *a* to *b*. After typing each number Max resets the calculator. Find the total number of segments printed on the calculator. 26 27 For example if *a* = 1 and *b* = 3 then at first the calculator will print 2 segments, then — 5 segments and at last it will print 5 segments. So the total number of printed segments is 12. 28 29 Input 30 31 The only line contains two integers *a*, *b* (1 ≤ *a* ≤ *b* ≤ 106) — the first and the last number typed by Max. 32 33 Output 34 35 Print the only integer *a* — the total number of printed segments. 36 37 Examples 38 39 Input 40 41 ``` 42 1 3 43 ``` 44 45 Output 46 47 ``` 48 12 49 ``` 50 51 Input 52 53 ``` 54 10 15 55 ``` 56 57 Output 58 59 ``` 60 39 61 ```