#include <bits/stdc++.h>
using namespace std;
int a[6], ans, res;
int main() {
  for (int i = 1; i <= 5; ++i) {
    cin >> a[i];
    ans += a[i];
  }
  sort(a + 1, a + 5 + 1);
  for (int i = 1; i <= 5; ++i) {
    int j = i;
    while (j < 5 && a[j + 1] == a[j]) ++j;
    if (j - i + 1 >= 2) {
      res = max(res, a[i] * min(3, j - i + 1));
    }
    i = j;
  }
  cout << ans - res;
  return 0;
}
