#include <bits/stdc++.h>
using namespace std;
const int N = 5e3;
const int M = 1e3 + 10;
const int INF = 2e9 + 1;
const long double EPS = 1e-10;
const long double PI = acos(-1);
int a[N];
string str(int n) {
  string ans;
  while (n > 0) {
    ans = (char)(n % 10 + '0') + ans;
    n /= 10;
  }
  return ans;
}
int main() {
  for (int i = 0; i < 5; i++) cin >> a[i];
  sort(a, a + 5);
  int sum = accumulate(a, a + 5, 0);
  int ans = sum;
  for (int i = 0; i < 4; i++)
    if (a[i] == a[i + 1]) ans = min(ans, sum - a[i] - a[i + 1]);
  for (int i = 0; i < 3; i++)
    if (a[i] == a[i + 1] && a[i] == a[i + 2])
      ans = min(ans, sum - a[i] - a[i + 1] - a[i + 2]);
  cout << ans;
}
