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