#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> m;
  int x, sum = 0;
  for (int i = 0; i < 5; i++) {
    scanf("%d", &x);
    m[x]++;
    sum += x;
  }
  int max = 0;
  for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) {
    if (it->second == 2) {
      x = it->first * 2;
      if (x > max) max = x;
    } else if (it->second >= 3) {
      x = it->first * 3;
      if (x > max) max = x;
    }
  }
  printf("%d", sum - max);
  return 0;
}
