#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a > b; }
long long i, a[6], ans, sum, n, Max;
int main() {
  for (i = 1; i <= 5; i++) {
    cin >> a[i];
    ans = ans + a[i];
  }
  sort(a + 1, a + 1 + 5, cmp);
  for (i = 1; i <= 5; i++) {
    if (a[i] == a[i - 1] && a[i - 1] == a[i - 2])
      Max = max(Max, a[i] * 3);
    else if (a[i] == a[i - 1])
      Max = max(Max, a[i] * 2);
  }
  cout << ans - Max << endl;
  return 0;
}
