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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
 
public class Solution {

	public static void main(String[] args) {
		InputReader in = new InputReader();
		PrintWriter out = new PrintWriter(System.out);
		Thread th = new Thread(null, new Runnable(){public void run(){new Task1().solve(in, out);}},"Task1",1<<24);
		try{
			th.start();
			th.join();
		} catch(InterruptedException e){}
		out.close();
	}
	
	static class Pair implements Comparable<Pair>{
		Integer first, second;
		public Pair(Integer first, Integer second){
			this.first = first;
			this.second = second;
		}

		public int compareTo(Pair x){
			return first.compareTo(x.first);
		}
	}

	static class Task1 {
		static final int MOD = 1000000007;
		static final int MAX = 200001;
		boolean[] isPrime;
		
		
		public void solve(InputReader in, PrintWriter out){ 
			int sum = 0;
			for(int i=0; i<5; i++)
				sum += in.nextInt();
			if(sum%5==0){
				out.println(sum/5);
			} else {
				out.println(-1);
			}
		}

		void sieve(){
			isPrime = new boolean[MAX];
			Arrays.fill(isPrime, true);
			isPrime[0] = isPrime[1] = false;
			for(int i=2; i<MAX; i++){
				if(isPrime[i]){
					for(int j=i+i; j<MAX; j+=i){
						isPrime[j] = false;
					}
				}
			}
		}

		long expo(long a, long b){
			long result = 1;
			while(b>0){
				if(b%2==1) result *= a;
				a = a*a;
				b = b>>1;
			}
			return result;
		}
	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public InputReader() {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			String s=null;
			try{
				s = reader.readLine();
			} catch(IOException e){
				throw new RuntimeException(e);
			}
			return s;
		}
		public String nextParagraph() {
			String line=null;
			String ans = "";
			try{
				while ((line = reader.readLine()) != null) {
				ans += line;
				}
			} catch(IOException e){
				throw new RuntimeException(e);
			}
			return ans;
		}
	}
}