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