#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3;
int main() {
  int num[5], a[1000] = {0}, sum = 0;
  for (int i = 0; i < 5; i++) {
    cin >> num[i];
    sum = sum + num[i];
    a[num[i]]++;
  }
  int ans = sum;
  int k = maxn;
  for (int i = 0; i < 5; i++) {
    if (a[num[i]] == 2)
      k = sum - num[i] * 2;
    else if (a[num[i]] > 2)
      k = sum - num[i] * 3;
    if (k < ans) ans = k;
  }
  cout << ans << endl;
  ;
  return 0;
}
