Problems
428 - Fail
SUBMIT PROBLEM

Fail

Time Limit: 1 sec

 

The Problem

Among X students, B in Bangla, M in Math and Y have passed in both subjects in any exam. Find how many students failed in both subjects.

 

Example

If X = 100, B = 88, M = 80, and Y = 70 then

2 students failed in both subjects.

 

The Input

Input file contain a series of line, each line contain four integer numbers X, B, M, and Y(0<X, B, M, Y<10000, X>B, X>M, X>Y, B>Y, M>Y). Input is terminated by EOF.

 

The Output

For each line of input, print how many students failed in both subjects in a separate line.

 

Sample Input

100 88 80 70

100 70 60 50

 

Sample Output

2

20

 

 

 

 

Problem Setter: Shahin ShamS