#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  map<int, int> digits;
  int el;
  int sum = 0;
  for (int i = 0; i < 5; ++i) {
    cin >> el;
    ++digits[el];
    sum += el;
  }
  int mn = sum;
  for (pair<int, int> el : digits) {
    if (el.second == 2) mn = min(mn, sum - el.first * 2);
    if (el.second > 2) mn = min(mn, sum - el.first * 3);
  }
  cout << mn;
  return 0;
}
