eolymp
Competitions

ДОРЕШИВАНИЕ 2014 ACM-ICPC Украина, 2ой Раунд Украина, Сентябрь 13

Divisibility by 3

Let's consider a sequence 1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 12345678910, 1234567891011, ....

Write a program that determines how many elements of this sequence among first n are divisible by three.

Input

One positive integer n (1n231 - 1).

Output

Print one number - the answer to the problem.

Time limit 1 second
Memory limit 128 MiB
Input example #1
4
Output example #1
2
Source 2014 ACM-ICPC Ukraine, 2nd Round Ukraine, September 13, Problem F