#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int a[5];
int tot = 0;
int cnt[N];
int main() {
  int x, sum = 0;
  for (int i = 0; i < 5; i++) cin >> x, cnt[x]++, sum += x;
  int mm = 0;
  for (int i = 0; i < N; i++)
    if (cnt[i] == 2)
      mm = max(mm, 2 * i);
    else if (cnt[i] > 2)
      mm = max(mm, 3 * i);
  cout << sum - mm << endl;
}
