Balls (кульки)
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
In a bag, there are balls of n different colors. You can draw several balls blindly from the bag. What is the maximum number of balls z1 you can draw such that none of them are of k1 specific colors? Also, determine the maximum number z2 of balls you can draw such that there might not be any balls of k2 specific colors.
Input Data
The first line contains the integers n (3 <= n <= 10), k1, k2, where 0 < k1, k2 < n. The second line provides the quantities of balls for each color, with each quantity ranging from one to 20 inclusive.
Output Data
Output the values z1, z2 on one line.
Examples
Input #1
Answer #1
Submissions 325
Acceptance rate 18%