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

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.StringTokenizer;


 public class Main {

   static int arr[] ;
  static int cost ; 
    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
    
   
    private static int mod(int x, int y)
{
    int result = x % y;
    return result < 0? result + y : result;
}
    
    public static void main(String[] args) throws java.lang.Exception {

        FastReader in = new FastReader();
        int a1 = in.nextInt() , a2 = in.nextInt()  , a3 = in.nextInt() , a4 = in.nextInt()  , a5 = in.nextInt() ;
         
       int sum = a1 + a2 + a3 + a4 + a5;
       
 
      System.out.println((mod(sum , 5)== 0) ? sum / 5 : "-1");
       
  }
    
     public static int firstElement(int low ,int  high,int num,int arr[])
     {
    
         int index = -1 ;
         while(low <= high)
         {
            int mid = (low+high)/2;
             
            if(arr[mid-1] == num)
            {
                high = mid - 1 ;
                index = mid ;
            }
            else{
                if(arr[mid - 1] > num )
                {
                   high = mid - 1 ;  
                }
                else
                {
                   low = mid + 1 ; 
                }
            }
      
         }
         return index ; 
     }
     
     public static int lastElement(int low ,int  high,int num,int arr[])
     {
    
             int index = -1 ;
         while(low <= high)
         {
            int mid = (low+high)/2;
             
            if(arr[mid-1] == num)
            {
                low = mid + 1 ;
                index = mid ;
            }
            else{
                if(arr[mid - 1] > num )
                {
                   high = mid - 1 ;  
                }
                else
                {
                   low = mid + 1 ; 
                }
            }
      
         }
         return index ; 
     }
      public static boolean check(int mid,int  s)
    {
      int sum  = 0 , temp = s , count = 0; 
        for (int k = 0; k < arr.length; k++) {
          
           int index = 1 ; 
            sum = arr[k] + (index * mid) ; 
        
           // s = s - sum ;
            count = 0 ;
           
            
            int trying = 1 ;
            ++count;
            for (int i = k+1; trying <= mid-1 && i <= arr.length-1; i++ , ++trying) 
            {
              
             ++index ;
             if((sum + (arr[i] + (((index)) * mid))) <= s )
             {
                 ++count;
               sum = (sum + (arr[i] + ((index) * mid))) ;
              // s = s - arr[i] + ((i+1) * mid);
             }
             else{
                 break;
             }
            }
            
            if(count == mid && sum <= s)
            {
                cost = sum ;
               return true;
              // return true;
            }
           if(mid == 3)
            System.out.println(sum+" "+count);
          
            
        }   
            /*
              int j = k + (mid - 1), i = k+1;
              
             for (  ; (i < j) && (((k) +(mid-1)) < arr.length) ; --j,++i) 
              {
                sum = sum + arr[j] + arr[i];
             
              }
             
             if(((mid-1)) % 2 != 0 && (((k) +(mid-1)) < arr.length) )
               sum = sum + arr[i];  
            
             
             if(sum <= time && (((k) +(mid-1)) < arr.length))
                 return true;
             */
        
       
        return false;
        
        
        
        
        
     
    }
    }


    
    
     
     /*
      int n = in.nextInt() , t = in.nextInt() ;
     boolean mark = false ;
        arr = new int[n];
        
        for (int i = 0; i < arr.length; i++) {
            arr[i] = in.nextInt();   
        }
        
      // Arrays.sort(arr);
     int low = 1 , high = n ,count = 0;
     
     while(low <= high)
     {
         int mid = (low+high)/2;
         
       
         if(check(mid,t))
         {
             low = mid + 1 ;
             count = mid ; 
         }
         else
         {
            high = mid - 1 ;
         }
     }
     
        System.out.println(count);
     */
    
   
  /*
    public static boolean check(int mid,int  t)
    {
      int sum  = 0 , time = t , temp = t, count = 0; 
        for (int k = 0; k < arr.length; k++) {
          
            sum = arr[k] ; 
        
              int j = k + (mid - 1), i = k+1;
              
             for (  ; (i < j) && (((k) +(mid-1)) < arr.length) ; --j,++i) 
              {
                sum = sum + arr[j] + arr[i];
             
              }
             
             if(((mid-1)) % 2 != 0 && (((k) +(mid-1)) < arr.length) )
               sum = sum + arr[i];  
            
             
             if(sum <= time && (((k) +(mid-1)) < arr.length))
                 return true;
             
        }
       
        return false;
        
        
        
        
        
     
    }
 
 */ 
