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

#include <bits/stdc++.h>
long long MM = 1000000007;
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0 || b == 0) return abs(a - b);
  long long res = a % b;
  while (res) {
    a = b;
    b = res;
    res = a % b;
  }
  return b;
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long numberofdiviser(long long a) {
  long long ans = 0;
  long long i;
  for (i = 1; i * i < a; i++) {
    if (a % i == 0) ans += 2;
  }
  if (i * i == a) ans++;
  return ans;
}
void fival(long long* a, long long b, long long n) {
  for (int i = 0; i < n; i++) {
    a[i] = b;
  }
}
long long sum, ans, l, r, x;
long long ss(vector<long long> a, vector<long long>& b, int ii) {
  for (int i = ii; i < a.size(); i++) {
    b.push_back(a[i]);
    sum += a[i];
    if (b.size() > 1 && sum >= l && sum <= r && b[b.size() - 1] - b[0] >= x)
      ans++;
    ss(a, b, i + 1);
    sum -= b[b.size() - 1];
    b.pop_back();
  }
  return ans;
}
unsigned long long fact(long long n) {
  if (n == 0) return 1;
  return n * fact(n - 1);
}
unsigned long long Combinations(unsigned long long n, unsigned long long r) {
  if (r > n) return 0;
  if (r * 2 > n) r = n - r;
  if (r == 0) return 1;
  unsigned long long res = n;
  for (int i = 2; i <= r; ++i) {
    res *= (n - i + 1);
    res /= i;
  }
  return res;
}
long long pow(long long a, long long b, long long m) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long long x = pow(a, b / 2, m);
  x = (x * x) % m;
  if (b % 2) x = (x * a);
  return x % m;
}
int solve() {
  int x;
  int sum = 0;
  for (int i = 0; i < 5; i++) {
    cin >> x;
    sum += x;
  }
  if (sum % 5 == 0 && sum != 0)
    cout << sum / 5;
  else
    cout << -1;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
