Numero di stringhe di bit

Dato un numero intero n, è richiesto di calcolare quante diverse stringhe di bit di lunghezza n esistono. Le stringhe di bit sono sequenze composte esclusivamente da 0 e 1.

Dati in ingresso

L’unica riga di input contiene un singolo intero n (1 ≤ n ≤ 30)

Dati in uscita

Il programma deve stampare il numero di stringhe di bit di lunghezza n.

Esempi

Ingresso
Uscita
3
8
4
16

Spiegazione

3 → 000, 001, 010, 011, 100, 101, 110, 111 ⇒ 8 stringhe di bit diverse.
4 → 000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111 ⇒ 16 stringhe di bit diverse.
 

Constraints

Time limit: 1 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue