{"raw_statement":[{"iden":"statement","content":"On a Friday afternoon, some members of MaratonIME decided to watch a movie at CinIME.\n\nThere were n members who received popcorn buckets numbered from 1 to n.\n\nAt a certain moment, bucket 1 had one popcorn, bucket 2 had two popcorns and so on until bucket n, which had n popcorns. As good competitive programmers, they always prefer to simplify things, and decided to gather all the popcorn in just one bucket.\n\nThey proceeded on the following way: In bucket 2, they gather the popcorn from buckets 1 and 2. Then, in bucket 3, those of bucket 2 and 3 and so on until the last bucket. Formally, they perform n - 1 movements, on the i-th movement they join the popcorn from buckets i and i + 1 on bucket i + 1. However, they are known to be clumsy and at each moment they join two buckets, they let a single popcorn fall to the ground, which they promptly throw in the trash.\n\nJiang, the Sharp, realized that maybe the last bucket would be too small to hold all of the popcorn. Therefore, he asked for your help to determine how much popcorn should remain in the last bucket. \n\nGiven n, the number of members who decided to watch the movie, print the amount of popcorn that would remain in bucket n. Keep in mind that exactly one popcorn is lost at each step.\n\nThe first line contains the integer n (2 ≤ n ≤ 3 * 109) – the number of members from MaratonIME who decided to watch the movie.\n\nAn integer: The amount of popcorn the last bucket should have.\n\n"},{"iden":"input","content":"The first line contains the integer n (2 ≤ n ≤ 3 * 109) – the number of members from MaratonIME who decided to watch the movie."},{"iden":"output","content":"An integer: The amount of popcorn the last bucket should have."},{"iden":"examples","content":"Input2Output2Input3Output4Input1000000Output499999500001"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ with $ 2 \\leq n \\leq 3 \\cdot 10^9 $.  \nLet the initial amount of popcorn in bucket $ i $ be $ i $, for $ i = 1, 2, \\dots, n $.  \n\n**Constraints**  \n- Total initial popcorn: $ \\sum_{i=1}^n i = \\frac{n(n+1)}{2} $  \n- $ n - 1 $ merging steps occur.  \n- At each step, exactly 1 popcorn is lost.  \n\n**Objective**  \nCompute the final amount of popcorn in bucket $ n $ after $ n - 1 $ merges, each losing 1 popcorn:  \n$$\n\\frac{n(n+1)}{2} - (n - 1)\n$$","simple_statement":"Start with buckets 1 to n, where bucket i has i popcorns.  \nAt each step i (from 1 to n-1), merge bucket i and i+1 into bucket i+1, but lose 1 popcorn.  \nFind how many popcorns remain in the last bucket after all merges.","has_page_source":false}