#include <bits/stdc++.h>
using namespace std;
int a[6];
int main() {
  ios::sync_with_stdio(false);
  int sum = 0;
  for (int i(0); i < int(5); ++i) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + 5);
  int ans = sum;
  for (int i(4); i >= int(0); --i) {
    int cnt = 0, res = 0;
    for (int j = i; cnt < 2 && j >= 0; --j, cnt++) {
      if (a[j] != a[i]) break;
      res += a[j];
    }
    if (cnt == 2) ans = min(ans, sum - res);
    cnt = 0, res = 0;
    for (int j = i; cnt < 3 && j >= 0; --j, cnt++) {
      if (a[j] != a[i]) break;
      res += a[j];
    }
    if (cnt == 3) ans = min(ans, sum - res);
  }
  cout << ans << endl;
  return 0;
}
