#K62272. Total Bollards Calculation

    ID: 31495 Type: Default 1000ms 256MiB

Total Bollards Calculation

Total Bollards Calculation

You are given four integers a, b, c, and d representing the number of bollards placed on each side of a square. Note that when simply summing these values, the corner bollards are counted twice. To get the correct count of unique bollards, you must subtract 4 from the total sum.

The required calculation can be expressed as: $$a + b + c + d - 4$$

Your task is to compute and output the total number of unique bollards required.

inputFormat

Input consists of a single line containing four space-separated integers: a, b, c, and d. Each integer satisfies 1 (\leq) a, b, c, d (\leq) 10000.

outputFormat

Output a single integer denoting the total number of unique bollards. The result is computed by the formula: $$a + b + c + d - 4$$.## sample

3 4 3 4
10