Packing Balls

Given counts of red, green, and blue balls, pack them all into minimum boxes where each box holds 1 to 3 balls of one color or three distinct colors.

Medium6GreedyMathDynamic programmingImplementationInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

You have RR red balls, GG green balls, and BB blue balls.

Pack all of them into boxes. One box holds 1, 2, or 3 balls.

The balls inside a single box must be all the same color or all different colors.

Write a program that finds the minimum number of boxes needed to pack every ball.

Input

The first line contains RR, GG, and BB, separated by spaces. (1R,G,B1001 \le R, G, B \le 100)

Output

Print the minimum number of boxes on the first line.

Note

The first example can be packed as (red, green, blue), (red, green), (red, red), (blue, blue, blue).

The second example is packed as (red, green, blue), (green, green, green), (green, green, green).