#K94497. Counting Valid Task Sequences

    ID: 38654 Type: Default 1000ms 256MiB

Counting Valid Task Sequences

Counting Valid Task Sequences

Polycarpus has a unique daily routine where he plans his tasks over a period of n days. On the first day, he has exactly 3 different tasks he can choose from. For every subsequent day, he can only continue with 2 possible tasks. Therefore, the number of valid sequences of tasks over n days is defined as follows:

\[ f(n)=\begin{cases} 3 & \text{if } n=1,\\ 2^{n-1} & \text{if } n>1. \end{cases} \]

Your task is to compute this value given the number of days n. Note that when n > 1, the answer is given by the expression $$2^{n-1}$$.

inputFormat

The input consists of a single integer n (1 ≤ n ≤ 1000), representing the number of days.

outputFormat

Output a single integer—the number of valid task sequences. For n = 1 output 3; otherwise, output $$2^{n-1}$$.

## sample
1
3