시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 99 35 29 50.877%

문제

n이 주어졌을 때 n의 팩토리얼인 n!을 구하는 것은 쉽다. 이번에는 n!이 주어졌을 때 n을 구해 보자.

입력

어떤 자연수 n에 대해 n!이 입력으로 주어진다. n!의 자리수는 106 이하이다.

출력

n을 출력한다.

예제 입력 1

120

예제 출력 1

5

예제 입력 2

51090942171709440000

예제 출력 2

21

예제 입력 3

10888869450418352160768000000

예제 출력 3

27
W3sicHJvYmxlbV9pZCI6IjEzMjk0IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjNWVkXHVkMzI5XHVkMWEwXHViOWFjXHVjNWJjIiwiZGVzY3JpcHRpb24iOiI8cD5uXHVjNzc0IFx1YzhmY1x1YzViNFx1Yzg0Y1x1Yzc0NCBcdWI1NGMgblx1Yzc1OCBcdWQzMjlcdWQxYTBcdWI5YWNcdWM1YmNcdWM3NzggbiFcdWM3NDQgXHVhZDZjXHVkNTU4XHViMjk0IFx1YWM4M1x1Yzc0MCBcdWMyN2RcdWIyZTQuIFx1Yzc3NFx1YmM4OFx1YzVkMFx1YjI5NCBuIVx1Yzc3NCBcdWM4ZmNcdWM1YjRcdWM4NGNcdWM3NDQgXHViNTRjIG5cdWM3NDQgXHVhZDZjXHVkNTc0IFx1YmNmNFx1Yzc5MC48XC9wPlxyXG4iLCJpbnB1dCI6IjxwPlx1YzViNFx1YjVhNCBcdWM3OTBcdWM1ZjBcdWMyMTggblx1YzVkMCBcdWIzMDBcdWQ1NzQgbiFcdWM3NzQgXHVjNzg1XHViODI1XHVjNzNjXHViODVjIFx1YzhmY1x1YzViNFx1YzljNFx1YjJlNC4gbiFcdWM3NTggXHVjNzkwXHViOWFjXHVjMjE4XHViMjk0IDEwPHN1cD42PFwvc3VwPiBcdWM3NzRcdWQ1NThcdWM3NzRcdWIyZTQuPFwvcD5cclxuIiwib3V0cHV0IjoiPHA+blx1Yzc0NCBcdWNkOWNcdWI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