40. Peas

Time Limit: 1 seconds

Memory Limit: 128 MB

Rating: 800

Problem Statement

The peashooters are gathered up for yet another fight! There are three types of peashooters in the game: The peashooter which shoots 1 pea. The repeater which shoots 2 peas. The gatling pea which shoots 4 peas. Given integers $p$, $r$ and $g$ which represent the number of peashooters, repeater and gatling pea respectively, find out the total number of peas which will be shot.

Input

The first three lines each contain integers $p$, $r$ and $g$ respectively. $(1 \le p, r, g \le 100000)$

Output

Output the answer described in the Problem Statement.

Sample Cases
Sample Input 1:
1
2
3

Sample Output 1:
17


Sample Input 2:
5 
3 
9

Sample Output 2:
47
Explanation

Not available for this problem.

Sources

KL Coding Cup March 2023 > Plants vs Zombies > Problem 1

Submit | Back