#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
long long exp(long long a, long long b) {
  long long ans = 1;
  while (b != 0) {
    if (b % 2) ans = ans * a;
    a = a * a;
    b /= 2;
  }
  return ans;
}
long long has[105];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long ans = 100000000000LL;
  long long sum = 0;
  for (long long i = (long long)0; i < (long long)5; i++) {
    long long a;
    cin >> a;
    has[a]++;
    sum += a;
  }
  for (long long i = (long long)1; i < (long long)101; i++) {
    long long val = sum;
    if (has[i] != 0) {
      if (has[i] == 2) {
        val -= 2 * i;
      }
      if (has[i] >= 3) {
        val -= 3 * i;
      }
    }
    ans = min(ans, val);
  }
  cout << ans << endl;
  return 0;
}
