99 100 100 100 100
 57 83 11 4 93
 99 99 99 99 99
 100 0 0 0 0
 0 1 2 3 4
 93 100 99 90 98
 87 38 19 33 100
 1 1 1 1 1
 0 0 0 0 1
 2 3 4 5 6
 1 2 1 2 3
 0 0 0 0 0
 100 100 100 100 100
 43 83 1 0 23
 43 83 1 100 23
 56 0 0 0 4
 99 98 98 99 100

-1
 -1
 99
 20
 2
 96
 -1
 1
 -1
 4
 -1
 -1
 100
 30
 50
 12
 -1

import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.*;
import java.text.*;
import java.util.regex.*;
public final class Main{
	static long mod = (long)10e9+7;
	static BufferedReader br;
	static PrintWriter pw;
	static StringBuilder OUTPUT;
	public static void main(String[] args)throws Exception{
		OUTPUT = new StringBuilder("");
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(System.out,true);//auto-flush enabled...
		new Main().timer();
		br.close();
		pw.close();
	}
	public static void timer()throws Exception{
		long S = System.currentTimeMillis();
		solve();
		long E = System.currentTimeMillis();
		//pw.println("Time elapsed : "+(E-S)+" ms.");
	}
	public static void solve()throws Exception{
		String[] s;
		int T = 1;
		//int T = Integer.parseInt(br.readLine());
		for(int I=0;I<T;I++){
			//code from here...
			s = br.readLine().split("\\s+");
			int total=0;
			for(int i=0;i<5;i++)
				total += Integer.parseInt(s[i]);
			if(total%5!=0)
				pw.println(-1);
			else
				pw.println(total/5);
		}
	}
}