Killjee and shop

0

0 votes
Easy
Problem

Killjee has balloons, he is going to his class from his hostel. There are shops between Killjee's class and hostel. The faculty has asked Killjee to bring exactly balloons. 

In each shop killjee can sell a balloon, buy a balloon or do nothing. You need to find highest number of balloons killjee can have at any moment during his journey from hostel to class.

 

INPUT

Input contains 3 integers. , and .

 

OUTPUT

Print answer to the given problem

 

CONSTRAINTS

Sample Input
5 7 8
Sample Output
10
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

He can buy 1 balloon in first four shop then sell 1 balloon in next 2 shop.

Editor Image

?