#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[5];
  int i, j, s = 0, s1, ans = 2147483647;
  for (i = 0; i <= 4; i++) {
    scanf("%d", &a[i]);
    s += a[i];
  }
  s1 = s;
  sort(a, a + 5);
  for (j = 4; j >= 0; j = i) {
    int c = 0;
    for (i = j; i >= 0; i--)
      if (a[i] == a[j])
        c++;
      else
        break;
    if (c >= 3) {
      c = 1;
      s = s1;
      s -= 3 * a[j];
    } else if (c == 2) {
      c = 1;
      s = s1;
      s -= 2 * a[j];
    }
    ans = min(ans, s);
  }
  cout << ans << endl;
  return 0;
}
