#include <bits/stdc++.h>
using namespace std;
int discard;
int card[6];
int main() {
  for (int i = 0; i < 5; i++) cin >> card[i];
  int cnt = 1;
  sort(card, card + 5);
  for (int i = 0; i < 5; i++)
    if (card[i] == card[i + 1])
      cnt++;
    else {
      if (cnt != 1) discard = max(discard, min(3, cnt) * card[i]);
      cnt = 1;
    }
  int sum = 0;
  for (int i = 0; i < 5; i++) sum += card[i];
  cout << sum - discard << endl;
  return 0;
}
