Subset Sums#3496

Subset Sums

1 second
128 megabytes
Very easy

For many sets of consecutive integers from to , it is possible to partition the set into two subsets with equal sums.

For example, if n = 3, one can partition the set \{ 1, 2, 3 \} in only one way so that the sums of both subsets are equal:

This is counted as a single partition (partitioning with subsets swapped is considered the same and does not increase the count).

If n = 7, there are four ways to partition the set \{1, 2, 3, \ldots, 7\} into two subsets with equal sums:

Given , determine the number of ways the set \{1, 2, \ldots, n\} can be partitioned into two subsets with equal sums. If no such partition exists, print 0.

Input

One integer (1 \leq n \leq 39).

Output

Print the number of possible partitions of \{1, 2, \ldots, n\} into two subsets with equal sums. Print 0 if no such partition exists.

Examples

Example 1

Loading
Loading