#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100 + 5] = {0};
  int sum = 0;
  for (int i = 0; i < 5; i++) {
    int tmp;
    cin >> tmp;
    sum += tmp;
    a[tmp]++;
  }
  int ans = INT_MAX;
  for (int i = 0; i <= 100; i++) {
    if (a[i] == 2) {
      ans = min(ans, sum - i * 2);
    } else if (a[i] >= 3) {
      ans = min(ans, sum - i * 3);
    }
  }
  if (ans != INT_MAX)
    cout << ans << endl;
  else
    cout << sum << endl;
  return 0;
}
