#C1409. Tom's Sequence
Tom's Sequence
Tom's Sequence
Tom's Sequence is defined as follows: Start with the number 1. For each subsequent term, if the previous term \(a_k\) is even, then \(a_{k+1} = \frac{a_k}{2}\); if it is odd, then \(a_{k+1} = 3a_k + 1\). Given an integer \(n\), your task is to compute the \(n\)-th term of the sequence.
inputFormat
The input is provided via standard input (stdin) and consists of a single integer \(n\) (\(1 \le n \le 10^6\)), which represents the position in Tom's Sequence that you need to determine.
outputFormat
Output the \(n\)-th term of Tom's Sequence to standard output (stdout).
## sample1
1