~/algor $ cat problems/uchliklar-soni
Triples with sum n
Medium
1000 ms
64 MB
48%
A positive integer $n$ is given. How many triples of positive integers $(a, b, c)$ satisfy $a + b + c = n$ and $1 \le a \le b \le c$?
Input
One positive integer $n$.
Output
One integer — the number of triples.
Note
$1 \le n \le 1000$
Examples
Input #1
7
Output #1
4
Input #2
3
Output #2
1