We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

- All Contests
- ProjectEuler+
- Project Euler #164: Numbers for which no three consecutive digits have a sum greater than a given value.

# Project Euler #164: Numbers for which no three consecutive digits have a sum greater than a given value.

# Project Euler #164: Numbers for which no three consecutive digits have a sum greater than a given value.

Contest ends in

_{This problem is a programming version of Problem 164 from projecteuler.net}

How many numbers (without any leading zero) exist such that no three consecutive digits of have a sum greater than 9?

Print answer modulo .

**Input Format**

One integer is given on first line representing .

**Constraints**

**Output Format**

Print one integer which is the answer modulo

**Sample Input 0**

```
3
```

**Sample Output 0**

```
165
```