#1289. 数字方格

数字方格

Background

Special for beginners, ^_^

Description

有3个方格,每个方格里面都有一个整数a1,a2,a3。已知0 <= a1, a2, a3 <= n,而且a1 + a2是2的倍数,a2 + a3是3的倍数, a1 + a2 + a3是5的倍数。你的任务是找到一组a1,a2,a3,使得a1 + a2 + a3最大。

Format

Input

多行,每行包含一个整数n (0 <= n <= 1e18)。.

Output

多行,每行输出一个整数,即a1 + a2 + a3的最大值。

Samples

3
0
5
0

Limitation

1s, 1024KiB for each test case.

Source

百练 OpenJudge #4146