#include <bits/stdc++.h>
int main() {
  int a[6], i, p, ans = 500, count[101], sum = 0;
  for (i = 1; i <= 100; i++) {
    count[i] = 0;
  }
  for (i = 0; i < 5; i++) {
    scanf("%d", &a[i]);
    sum = sum + a[i];
    count[a[i]]++;
  }
  p = sum;
  for (i = 0; i < 5; i++) {
    if (count[a[i]] == 2) {
      p = sum - 2 * a[i];
    }
    if (count[a[i]] > 2) {
      p = sum - 3 * a[i];
    }
    if (p <= ans) {
      ans = p;
    }
  }
  printf("%d\n", ans);
  return 0;
}
