Олимпиадный тренинг

Задача 38279. Triple Fibonacci


Задача

Темы: Остатки
Fifth grader Lenya recently read an article about Fibonacci numbers.

The Fibonacci numbers are the numerical sequence F1 , F2 , ..., Fn , ... , which is arranged as follows thus: F1 = 1 , F2 = 2 , and each next number is calculated as the sum of the previous two: if i ≥ 3 , then F i = Fi - 1 + Fi - 2 . The Fibonacci sequence thus begins with the numbers 1, 2, 3, 5, 8, 13, 21, ... .

Today Lenya is studying Fibonacci numbers with numbers from L to R, inclusive. Since Lenya loves the number 3 very much, he wondered how many Fibonacci numbers among those that he studies today are divisible by 3. For example, if L = 3 and R = 7 , then Lenya will study the numbers F3 = 3 , F4 = 5 , F5 = 8 , F6 =&thinsp ;13 and F7 = 21 . Among them, two numbers are divisible by 3: F3 = 3 and F7 = 21 .

Write a program that will help Lena find the answer to his question.

Input
The first line of the input contains the number L , and the second — number R ( 1 ≤ L ≤ R ≤ 105 ).

Imprint
Print a single number — the number of Fibonacci numbers with numbers from L to R , inclusive, that are divisible by 3.
 
# Input Output
1 3
7
2