import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner stdIn = new Scanner(System.in); int x = stdIn.nextInt(); int y = stdIn.nextInt(); int z = stdIn.nextInt(); for(int i = z; i > 0; i--){ if(x >= y){ y++; }else{ x++; } } System.out.println(Math.min(x, y)); } }