#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e18;
long long max(long long a, long long b) { return (a > b) ? a : b; }
long long min(long long a, long long b) { return (a < b) ? a : b; }
void solve() {
  vector<long long> v(5);
  long long sum = 0;
  for (long long i = 0; i < 5; i++) {
    cin >> v[i];
    sum += v[i];
  }
  sort(v.begin(), v.end());
  long long best = 0;
  for (long long i = 0; i < 5; i++) {
    if (i + 1 < 5 && v[i] == v[i + 1]) {
      best = max(best, 2 * v[i]);
    }
    if (i + 2 < 5 && v[i] == v[i + 2]) {
      best = max(best, 3 * v[i]);
    }
  }
  cout << sum - best << "\n";
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
