e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Strange ice hockey tournament

Strange ice hockey tournament

prb2070Forest dwellers, knownto youontaskin "1326. Inthe presentplay hockey..." и "1961. Forestresidents" spend theirstrangetournament, whichisnowknowninmanycircles.It is known thatthe tournamentinvolvedteamskandatthe moment amongallthree teamsare at least twohave not playedwith each other.What is the maximumnumber of matchesmaybe playedat the moment?

Input

A single number- the number ofparticipating teamsk (3k2000000001).

Output

A single number- the answerto the question posedin the problem.

Time limit 0.5 seconds
Memory limit 64 MiB
Input example #1
11
Output example #1
30
Author Анатолий Присяжнюк
Source Open and Distance Olympiads 2011-2012