#C11188. Minimum Spells to Collect Gems
Minimum Spells to Collect Gems
Minimum Spells to Collect Gems
You are given three non-negative integers r, b, and g which denote the required number of red, blue, and green gems respectively. In this problem, you need to calculate the minimum number of spells required such that you collect at least the given number of each type of gem.
Each spell yields exactly one gem. Thus, the minimum number of spells required is given by the formula:
$r + b + g$
For example, if r = 3, b = 2 and g = 1 then the minimum number of spells required is 3+2+1 = 6
.
inputFormat
The input consists of a single line containing three space-separated integers r, b, and g representing the number of red, blue, and green gems required, respectively.
It is guaranteed that 0 ≤ r, b, g ≤ 109.
outputFormat
Output a single integer which is the minimum number of spells required to obtain at least r red gems, b blue gems, and g green gems.
## sample0 0 0
0