시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 256 MB147321750.000%

문제

양의 정수 N의 자리곱은 N의 모든 자리를 곱한 것이다. 예를 들어, 2612의 자리곱은 2×6×1×2 = 24 이다.

어떤 수 N의 자기곱은 N과 N의 자리곱을 곱한 수이다. 예를 들어, 2612의 자기곱은 2612×24 = 62688이다.

두 양의 정수 A와 B가 주어졌을 때, 자기곱이 A보다 크거나 같고, B보다 작거나 같은 양의 정수의 개수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 두 정수 A와 B가 주어진다. (1 ≤ A ≤ B < 1018)

출력

자기곱이 A보다 크거나 같고, B보다 작거나 같은 양의 정수의 개수를 출력한다.

예제 입력 1

20 30

예제 출력 1

2

예제 입력 2

145 192

예제 출력 2

4

19, 24, 32, 41의 자기곱은 171, 192, 192, 164 이다.

예제 입력 3

2224222 2224222

예제 출력 3

1
W3sicHJvYmxlbV9pZCI6IjI5NzQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM3OTBcdWFlMzBcdWFjZjEiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzU5MVx1Yzc1OCBcdWM4MTVcdWMyMTggTlx1Yzc1OCBcdWM3OTBcdWI5YWNcdWFjZjFcdWM3NDAgTlx1Yzc1OCBcdWJhYThcdWI0ZTAgXHVjNzkwXHViOWFjXHViOTdjIFx1YWNmMVx1ZDU1YyBcdWFjODNcdWM3NzRcdWIyZTQuIFx1YzYwOFx1Yjk3YyBcdWI0ZTRcdWM1YjQsIDI2MTJcdWM3NTggXHVjNzkwXHViOWFjXHVhY2YxXHVjNzQwIDImdGltZXM7NiZ0aW1lczsxJnRpbWVzOzIgPSAyNCBcdWM3NzRcdWIyZTQuPFwvcD5cclxuXHJcbjxwPlx1YzViNFx1YjVhNCBcdWMyMTggTlx1Yzc1OCBcdWM3OTBcdWFlMzBcdWFjZjFcdWM3NDAgTlx1YWNmYyZuYnNwO05cdWM3NTggXHVjNzkwXHViOWFjXHVhY2Y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