#include <bits/stdc++.h>
using namespace std;
int a[111];
int main() {
  int ans = 0, m = 0;
  for (int i = 1; i <= 5; i++) {
    int x;
    cin >> x;
    a[x]++;
    ans += x;
    if (a[x] > 1) {
      m = max(m, x * min(3, a[x]));
    }
  }
  cout << ans - m;
}
