#include <bits/stdc++.h>
using namespace std;
int a[6];
int main() {
  int res = 0, flag = 0, maxx = 0;
  map<int, int> mp;
  for (int i = 0; i < 5; i++) {
    scanf("%d", &a[i]);
    mp[a[i]]++;
    res += a[i];
  }
  sort(a, a + 5);
  for (int i = 4; i >= 0; i--) {
    if (mp[a[i]] >= 3) {
      maxx = max(maxx, a[i] * 3);
    } else if (mp[a[i]] == 2) {
      maxx = max(maxx, a[i] * 2);
    }
  }
  res -= maxx;
  cout << res << endl;
  return 0;
}
