text: Count the number of 5 in the prime factorisation of N
code: while ( N % 5 == 0 ) { N /= 5 ; fives ++ ; } if ( N == 1 && twos <= fives ) { document . write ( 2 * fives - twos ) ; } else { document . write ( - 1 ) ; } }