#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  int a[101] = {0};
  for (int i = 0; i < 5; i++) {
    int k;
    cin >> k;
    a[k]++;
    ans = ans + k;
  }
  int mn = 1001;
  for (int i = 1; i <= 100; i++) {
    if (a[i] > 1) {
      mn = min(mn, ans - (i * min(3, a[i])));
    }
  }
  if (mn == 1001) {
    cout << ans;
    return 0;
  }
  cout << mn;
}
