#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> vec;
  int sum = 0;
  for (int i = 0; i < 5; i++) {
    int temp;
    scanf("%d", &temp);
    vec.push_back(temp);
    sum += temp;
  }
  int maxi = 0;
  for (int i = 0; i < 5; i++) {
    int counter = 1;
    int cursum = 0;
    for (int j = i + 1; j < 5; j++) {
      if (vec[j] == vec[i] && counter < 3) {
        counter++;
      }
    }
    if (counter != 1) cursum = vec[i] * counter;
    if (cursum > maxi) maxi = cursum;
  }
  sum -= maxi;
  printf("%d", sum);
  return 0;
}
