#K36912. Sum of Even Fibonacci Numbers

    ID: 25860 Type: Default 1000ms 256MiB

Sum of Even Fibonacci Numbers

Sum of Even Fibonacci Numbers

Given a positive integer \(N\), your task is to compute the sum of all even Fibonacci numbers that do not exceed \(N\). The Fibonacci sequence is defined as:

\(F_0 = 0,\; F_1 = 1,\; F_n = F_{n-1} + F_{n-2} \; \text{for} \; n \geq 2\).

You should sum all the even-valued terms in this sequence that are \(\leq N\).

Example: For \(N=100\), the even Fibonacci numbers are \(0, 2, 8, 34\), and their sum is \(44\).

inputFormat

The input consists of a single integer \(N\) read from standard input.

outputFormat

Output a single integer representing the sum of even Fibonacci numbers not exceeding \(N\), printed to standard output.

## sample
100
44