#include <bits/stdc++.h>
int a[55];
int ans = 0;
int main() {
  ans = 0;
  for (int i = 0; i < 5; ++i) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < 5; ++i) {
    int count = 1;
    for (int j = i + 1; j < 5; ++j) {
      if (a[j] == a[i]) count++;
    }
    if (count > 3) count = 3;
    if (count == 1) continue;
    if (count * a[i] > ans) ans = count * a[i];
  }
  ans = -ans;
  for (int i = 0; i < 5; ++i) ans += a[i];
  printf("%d\n", ans);
  fflush(stdout);
  return 0;
}
