#D4890. Mirrored

    ID: 4064 Type: Default 2000ms 268MiB

Mirrored

Mirrored

For a positive integer n, we denote the integer obtained by reversing the decimal notation of n (without leading zeroes) by rev(n). For example, rev(123) = 321 and rev(4000) = 4.

You are given a positive integer D. How many positive integers N satisfy rev(N) = N + D?

Constraints

  • D is an integer.
  • 1 ≤ D < 10^9

Input

Input is given from Standard Input in the following format:

D

Output

Print the number of the positive integers N such that rev(N) = N + D.

Examples

Input

63

Output

2

Input

75

Output

0

Input

864197532

Output

1920

inputFormat

Input

Input is given from Standard Input in the following format:

D

outputFormat

Output

Print the number of the positive integers N such that rev(N) = N + D.

Examples

Input

63

Output

2

Input

75

Output

0

Input

864197532

Output

1920

样例

63
2