#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  vector<int> a(5);
  for (int i = 0; i < 5; i++) {
    scanf("%d", &a[i]);
    ans += a[i];
  }
  sort(a.begin(), a.end());
  for (int i = 4; i >= 0; i--) {
    int j, t = 0;
    for (j = i - 1; j >= i - 2 && a[j] == a[i]; j--)
      ;
    j++;
    if (j != i) {
      for (int ii = 0; ii < j; ii++) t += a[ii];
      for (int ii = i + 1; ii < 5; ii++) t += a[ii];
      ans = min(ans, t);
    }
  }
  printf("%d", ans);
  return 0;
}
