Submit solution

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 1G

Author:
Problem type

You are given two positive integers, A and B. Define Ox as the decimal number consisting of x consecutive ones. For example, O4=1111. Determine the number of ones in the decimal representation of OA×OB.

Constraints

1A,B109

Subtask 1 [20%]

1A,B105

Subtask 2 [80%]

No additional constraints.

Input Specification

The first line contains two space-separated integers, A and B.

Output Specification

Output one line containing one integer, the number of ones in the decimal representation of OA×OB.

Sample Input 1

Copy
3 5

Sample Output 1

Copy
2

Explanation for Sample 1

O3×O5=111×11111=12333212 ones.

Sample Input 2

Copy
314159 265358

Sample Output 2

Copy
29486

Comments

There are no comments at the moment.