Sweet Child Makes Trouble#1536

Sweet Child Makes Trouble

1 second
64 megabytes
Very easy

Children are always sweet, but sometimes they can make things difficult for their parents. In this problem, you will see how Tintin, a five-year-old boy, creates trouble for his parents. Tintin is a joyful boy and is always busy doing something. However, his activities do not always bring joy to his parents. He especially likes to play with household items such as his father's wristwatch or his mother's comb. After playing, he does not return the items to their original places. Tintin is very intelligent and has a sharp memory. He bothers his parents by never putting things he has taken for play back to their original positions.

Imagine this: one morning, Tintin managed to take three household items. In how many different ways can he return the items so that none of them end up in their original place? Tintin does not hide anything in completely new locations; he merely rearranges the items.

Input

The input consists of several test cases. Each test case contains a positive integer not exceeding — the number of items Tintin has taken to play with. Each integer is given on a separate line. The last line contains (minus one) and should not be processed.

Output

For each test case, print one integer: the number of ways Tintin can rearrange the items he took so that none of them ends up in its original place.

Examples

Example 1

Loading
Loading