import java.io.InputStream; import java.io.PrintWriter; import java.lang.reflect.Array; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Scanner; import java.util.Set; import java.util.TreeSet; import static java.util.Comparator.*; public class Main { public static void main(String[] args) { PrintWriter out = new PrintWriter(System.out); Solver solver = new Solver(System.in, out); solver.solve(); out.close(); } } class Solver { Scanner sc; PrintWriter out; public Solver(InputStream in, PrintWriter out) { sc = new Scanner(in); this.out = out; } // ================================================================== public void solve() { int X = Integer.parseInt(sc.next()); int Y = Integer.parseInt(sc.next()); int Z = Integer.parseInt(sc.next()); int sa = Math.abs(X-Y); if(sa == 0) out.println(X + Z/2); else if(sa <= Z) out.println(Math.max(X, Y) + (Z - sa)/2); else out.println(Math.min(X, Y) + Z); } // ================================================================== } class PP{ public int key, val; public PP(int key, int val) { this.key = key; this.val = val; } public int getKey() { return key; } public int getVal() { return val; } }