#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int i, a[5], j, k, s = 0, s1, ms;
  for (i = 0; i < 5; i++) {
    cin >> a[i];
    s += a[i];
  }
  ms = s;
  for (i = 0; i < 4; i++) {
    k = 1;
    for (j = i + 1; j < 5; j++)
      if (a[j] == a[i]) k++;
    if (k >= 2) {
      if (k == 2) s1 = s - 2 * a[i];
      if (k >= 3) s1 = s - 3 * a[i];
      if (s1 < ms) ms = s1;
    }
  }
  cout << ms;
  return 0;
}
