#P4885. Table Decorations

Table Decorations

Table Decorations

题面翻译

题目描述

您正在为宴会装饰桌子,有 rr 个红色,gg 个绿色和 bb 蓝色的气球,一张桌子需要三个颜色不完全相同的气球来装饰。

您需要求出可以用所需方式进行装饰的桌子的最大数量 tt

输入格式

单行包含三个整数 r,g,b(0<=r,g,b<=2109)r,g,b (0<=r,g,b<=2*10^{9}),表示红色,绿色和蓝色气球的数量。

输出格式

输出一个整数 tt 表示可以按要求的方式装饰的桌子的最大数量。

题目描述

You have r r red, g g green and b b blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to some table shouldn't have the same color. What maximum number t t of tables can be decorated if we know number of balloons of each color?

Your task is to write a program that for given values r r , g g and b b will find the maximum number t t of tables, that can be decorated in the required manner.

输入格式

The single line contains three integers r r , g g and b b ( 0<=r,g,b<=2109 0<=r,g,b<=2·10^{9} ) — the number of red, green and blue baloons respectively. The numbers are separated by exactly one space.

输出格式

Print a single integer t t — the maximum number of tables that can be decorated in the required manner.

样例 #1

样例输入 #1

5 4 3

样例输出 #1

4

样例 #2

样例输入 #2

1 1 1

样例输出 #2

1

样例 #3

样例输入 #3

2 3 3

样例输出 #3

2

提示

In the first sample you can decorate the tables with the following balloon sets: "rgg", "gbb", "brr", "rrg", where "r", "g" and "b" represent the red, green and blue balls, respectively.