import java.util.*; class Main{ public static void main (String[] args) { Scanner s = new Scanner(System.in); int X =s.nextInt(); int Y =s.nextInt(); int Z =s.nextInt(); int p = Math.max(X,Y); int q = Math.min(X,Y); int r = p-q; int m,n; if (r <= Z) { m = r; n = (Z-r)/2; }else{ m = Z; n = 0; } System.out.println(q+m+n); } }