#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int t[5], i, j, sum = 0, r = 0;
  for (i = 0; i < 5; i++) {
    cin >> t[i];
    sum = sum + t[i];
  }
  for (i = 0; i < 5; i++) {
    int count = 1;
    for (j = i + 1; j < 5; j++) {
      if (t[i] == t[j]) count++;
    }
    if (count >= 3) count = 3;
    if (count >= 2 && (t[i] * count) > r) r = t[i] * count;
  }
  sum = sum - r;
  cout << sum << endl;
  return 0;
}
