Attendance Award

No attempts yetTime limit1sMemory limit256 MB

Problem

A school of engineering pays a prize to students who miss few classes and are rarely late. A student loses the prize by being absent on three days in a row, or by being late more than once.

Over a span of NN days a student's attendance record is a string of NN characters, each one L (late), O (on time), or A (absent).

There are 81 records covering four days, and exactly 43 of them win the prize.

OOOO OOOA OOOL OOAO OOAA OOAL OOLO OOLA OAOO OAOA OAOL OAAO OAAL OALO OALA
OLOO OLOA OLAO OLAA AOOO AOOA AOOL AOAO AOAA AOAL AOLO AOLA AAOO AAOA AAOL
AALO AALA ALOO ALOA ALAO ALAA LOOO LOOA LOAO LOAA LAOO LAOA LAAO

How many records covering NN days win the prize?

Input

The input holds several tests. Each line holds one integer NN (1N30001 \le N \le 3000). The input ends at the end of the file.

Output

For each test, print the number of winning records on a line of its own. The count grows very large, so print it in full without taking any remainder.