Three numbers a, b, c are given. Calculate the value of the function for a given number n:
Four integers a, b, c~(|a|, |b|, |c| \leq 1000), n~(0 \leq n \leq 1000) are given.
Output the value of the function f(n).
Example 1