eolymp
bolt
Try our new interface for solving problems
Problems

School Olympiad

School Olympiad

At school programming contest the participants were asked to solve two problems. $a$ students totally coped with the given tasks, and $b$ students solve nothing. How many participants were in competition if there was accepted $c$ correct submitions for the first task, and $d$ submitions for the second task. \InputFile Nonnegative integers $a, b, c$ and $d$, not greater than $100$. \OutputFile Print the number of participants at school programming contest.
Time limit 1 second
Memory limit 128 MiB
Input example #1
1 2 3 4
Output example #1
8