~/algor $ cat problems/if-juft-bolsa-yarmi
Half if even
Easy
1000 ms
64 MB
15%
A positive integer $n$ is given. If $n$ is even, divide it by $2$; if it is odd, replace it with $3 * n + 1$. Find the resulting number.
Input
One positive integer $n$.
Output
One integer — the result.
Note
$1 \le n \le 10^{9}$
Examples
Input #1
6
Output #1
3
Input #2
7
Output #2
22