Simple Arithmetic 1

2 secs 1024 MB
Rute's icon Rute

Problem Statement

For Mr.Rute , a one problem was prepared.

「given a integer NN. Find the number of pairs of non-negative integers (i,j,k)(i, j, k) that satisfy the following conditions.」

contditions
100100 * ii + 1010 * jj + 11* kk = NN
jj is greater than or equal to ii
kk is greater than or equal to jj
・ Easy to say, The following formula must hold
・ Formula ijki \leq j \leq k

Making a Program and culculate the number of pairs of non-negative integers (i,j,k)(i,j,k)

Constraints

1N10001 \leq N \leq 1000

Input

NN

Output

Please Output the number of pairs of non-negative integers (i,j,k)(i,j,k)

Sample

Input1
11
Output1
2

When N=11N = 11 , (i,j,k)=(0,1,1)(i,j,k) = (0,1,1) and (i,j,k)=(0,0,11)(i,j,k) = (0,0,11) are meet the conditions

Input2
76
Output2
7

For Example、When (i,j,k)=(0,7,6)(i,j,k) = (0,7,6),The condition is not met.

Input3
188
Output3
26
Input4
1000
Output4
460

Submit


Go (1.21)