Олимпиадный тренинг

Задача 38581. Numbers in multiplication


Задача

Темы:
Given an integer N (\(1<=N<=10^{10}\)).
Given two positive integers A and B , define \(F (A, B)\) as the larger of the two: 
- number of digits in decimal notation A;
- number of digits in the decimal representation of the number B.
For example, \(F (3,11) = 2\) because 3 is one digit and 11 is two.
Find the minimum value of \(F (A, B)\) among all pairs of positive integers A and B such that \(N = A \cdot B\).

Input
The input is an integer N (\(1<=N<=10^{10}\)).

Imprint
Display the answer to the problem.
 

 

Examples
# Input Output Explanation
1 10000 3 \(F(A,B) \) has a minimum value when \((A,B )=(100,100)\).
2 1000003 7 There are two pairs A and B, so that the condition of the problem is fulfilled: \((1, 1000003)\) and \((1000003,1)\). For these pairs, \(F(1,1000003)=F(1000003,1)=7\).
3 9876543210 6