Time limit
2s
Memory limit
128 MB
The starting number is 1. You want to make the number N by applying the following three operations in any order.
Find the minimum number of operations needed to make N.
The first line contains a positive integer N. N is at most 10^18.
Print the minimum required number of operations on the first line.