#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
signed main(void) {
  vector<long long> in(101, 0);
  long long sum = 0;
  for (long long i = 0; i < (5); i++) {
    long long a;
    cin >> a;
    in[a]++;
    sum += a;
  }
  long long ans = sum;
  for (long long i = 0; i < (101); i++)
    if (in[i] > 1) ans = min(ans, sum - min(in[i], 3LL) * i);
  cout << ans << endl;
}
