#include <bits/stdc++.h>
using namespace std;
int a[10], sum, n = 5, ans = -1234567890, k;
int main() {
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n);
  for (int i = 3; i >= 0; i--) {
    if (a[i] == a[i + 1] && a[i] == a[i + 2])
      ans = max(ans, a[i] + a[i + 1] + a[i + 2]);
    else if (a[i] == a[i + 1])
      ans = max(ans, a[i] + a[i + 1]);
  }
  if (sum - ans >= 1234567890) return cout << sum, 0;
  cout << sum - ans;
}
