Problem list
Log in
#r03241 · Online Judge > GoldOJ

Sum of 1, 2, 3

Silver III 2.0 s 256 MB

Count the number of ordered ways to write $N$ as a sum of $1$s, $2$s, and $3$s (order matters). Print that count.

Input

One integer $N$ ($1 \le N \le 20$).

Output

Print the number of ordered ways.

Example 1

Input
4
Output
7
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code