{"trustable":false,"sections":[{"title":"","value":{"format":"PLAIN","content":"A friend of yours has written a program that compares every pair of a list of items. With n items,\nit works as follows. First, it prints a 1, and it compares item 1 to items 2, 3, 4, . . . , n. It then prints\na 2, and compares item 2 to items 3, 4, 5, . . . , n. It continues like that until every pair of items has\nbeen compared exactly once. If it compares item x to item y, it will not later compare item y to\nitem x. Also, it does not compare any item to itself.\nYour friend wants to know when his program is halfway done. For a program that makes an odd\nnumber of total comparisons, this is when it is doing the middle comparison. For a program that\nmakes an even number of total comparisons, this is when it is doing the first of the two middle\ncomparisons.\nWhat will the last number printed be when the program is halfway done?\nNote that since the earlier items have more comparisons than the later items, the answer is not\nsimply n/2.\nInput\nThe input consists of a single line containing the integer n (2 ≤ n ≤ 109\n).\nOutput:\nPrint, on a single line, the last number your friend’s program prints when it is halfway done.\n\nSample Input:\n4\n\nOutput:\n1"}}]}