#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
long long const inf = 3e18, linf = 2e9, mod = 1e9 + 7, inf2 = 1e12;
int const mxn = 3e5 + 10;
long long poww(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}
int a[10];
int main() {
  cin >> a[1] >> a[2] >> a[3] >> a[4] >> a[5];
  int sum = a[1] + a[2] + a[3] + a[4] + a[5];
  int ans = sum;
  for (int i = 1; i <= 5; i++) {
    for (int j = i + 1; j <= 5; j++) {
      if (a[i] == a[j]) ans = min(ans, sum - 2 * a[i]);
    }
  }
  for (int i = 1; i <= 5; i++) {
    for (int j = i + 1; j <= 5; j++) {
      for (int k = j + 1; k <= 5; k++) {
        if (a[i] == a[j] and a[j] == a[k]) ans = min(ans, sum - a[i] * 3);
      }
    }
  }
  cout << ans;
}
