import java.util.Arrays; import java.util.Scanner; public class Main_yukicoder91 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] rgb = new int[3]; for (int i = 0; i < 3; i++) { rgb[i] = sc.nextInt(); } Arrays.sort(rgb); int l = 0; int r = 10_000_001; while (r > l) { int mid = (r + l) / 2; int value = 0; int value2 = 0; for (int i = 0; i < 3; i++) { if (rgb[i] >= 10_000_000 - mid) { int tmp = rgb[i] - (10_000_000 - mid); if (tmp > 1) { value += tmp; } } else { value2 += (10_000_000 - mid) - rgb[i]; } } if (value >= value2 * 2) { r = mid; } else { l = mid + 1; } } System.out.println(10_000_000 - r); sc.close(); } }