#B4072. Photo Sharing - Calculate Additional Photos Needed

    ID: 11729 Type: Default 1000ms 256MiB

Photo Sharing - Calculate Additional Photos Needed

Photo Sharing - Calculate Additional Photos Needed

During the National Day holiday, Xiao Ming traveled with his parents and took many beautiful landscape photos. On the night before returning home, he organized all his photos: he had \(x\) photos on his phone, \(y\) photos on his tablet, and \(z\) photos on his DSLR camera. After school starts, he plans to share \(n\) photos with his classmates. The task is to determine the minimum number of additional photos he needs to take if the current total is less than \(n\).

In other words, compute the quantity \(\max(0, n - (x + y + z))\).

inputFormat

The input contains four integers: \(x\), \(y\), \(z\), and \(n\) separated by spaces.

outputFormat

Output a single integer, representing the number of additional photos Xiao Ming needs to take.

sample

10 20 30 100
40