Start 2022-01-28 15:40:00

2022寒假D1(1)

End 2022-02-05 00:00:00
Contest is over.
Now 2025-10-14 05:57:50

C. 火柴棒等式

Description

给你n根火柴棒,你可以拼出多少个形如“A+B=C”的等式?等式中的A、B、C是用火柴棒拼出的整数(若该数非零,则最高位不能是0)。用火柴棒拼数字0~9的拼法如图所示:

注意:

1.加号与等号各自需要两根火柴棒。

2.如果A≠B,则A+B=C与B+A=C视为不同的等式(A、B、C ≥ 0)

3.n根火柴棍必须全部用上。

Input

共一行,一个整数n(n ≤ 24)。

Output

共一行,表示能拼成的不同等式的数目。

Examples

Input

14

Output

2

Input

18

Output

9

Hint

样例1解释

2个等式为

0+1=1 1+0=1

样例2解释

9个等式为:

0+4=4

0+11=11

1+10=11

2+2=4

2+7=9

4+0=4

7+2=9

10+1=11

11+0=11


Submit

Login

Signup
Time Limit 1 second
Memory Limit 128 MB
Submit