import java.util.*; class Main{ public static void main(String[] $) { Scanner s=new Scanner(System.in); int x=s.nextInt(),y=s.nextInt(),z=s.nextInt(); int r=Math.min(x,y),q=Math.max(x,y)-r; System.out.println(r+(q<=z?(q+z)/2:z)); } }