CodeLab Academy 📞 9936 6696
← List Python · Level 4: For loops Code · 40 points ← #310 #312 →

#311. Alternating sum

You get n. Find the sum 1 - 2 + 3 - 4 + ... ± n. ### Input One integer n (1 ≤ n ≤ 1000). ### Output One integer.

Examples

Input
304
Output
-152
Input
262
Output
-131

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!