Submit solution

Points:
5 (partial)

Time limit:
0.1s

Java
0.3s

Memory limit:
16M

Author:

Problem type

Allowed languages

Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, ~~CommonLisp~~, D, Dart, F#, Forth, Fortran, Go, ~~Groovy~~, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, ~~Nim~~, ~~ObjC~~, OCaml, ~~Octave~~, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Lyestria is observing a group of frogs. The frogs are numbered from to .

The frog numbered conveniently lives at the point . On this day, the frog numbered wants to go to the point , where all the points are equally spaced.

Lyestria then asks you to compute the sum of the distances each frog must travel to get to their desired location.

#### Constraints

#### Input Specification

The first line contains one integer, , the number of frogs.

#### Output Specification

On one line, output one integer, the sum of the distances each frog must travel to get home.

#### Sample Input

`4`

#### Sample Output

`8`

#### Sample Input 2

`5`

#### Sample Output 2

`12`

## Comments