프로그램 명: coci_tresnja
제한시간: 1 초

Lana lives in a small but merry village. There is a row of cherry trees next to the main street. Lana numbered the trees with consecutive integers starting with 1. After much studying, Lana noticed that the number of the tree uniquely determines the amount of cherries the tree gives.

For one tree, consider consecutive groups of digits in the tree's number. For each group of digits, multiply the digit by the square of the length of the group. Adding these numbers for all groups gives the total number of cherries the tree gives.

For example, in tree number 77744007, the groups are 777, 44, 00 and 7. The amount of cherries will be 7·3^2 + 4·2^2 + 0·2^2 + 7·1^2 = 86 units.

The time has come to pick the cherry trees and the villagers have agreed to pick all trees numbered A through B (inclusive). Write a program that will calculate the total amount of cherries picked.

입력

Input consists of two integers A and B (1 ≤ A ≤ B ≤ 10^15), the first and last trees to be picked.

출력

Output a single integer, how many units of cherries will be picked.

입출력 예

input 

1 9 

output 

45 

input 

100 111 

output 

68 

input 

7774407 7774407 

output 

86 
출처: coci 2008/2009 contest5 5/6

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]