import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int x = Integer.parseInt(sa[0]); int y = Integer.parseInt(sa[1]); int z = Integer.parseInt(sa[2]); br.close(); if (x > y + z) { System.out.println(y + z); } else if (x + z < y) { System.out.println(x + z); } else { System.out.println((x + y + z) / 2); } } }