#include <bits/stdc++.h>
using namespace std;
int arr[10], tempp, k = 0, p = 0, q = 0, sum = 0, minn = 1e4;
int main() {
  for (int i = 0; i < 5; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  while (q < 5) {
    k = sum;
    tempp = arr[q];
    for (int i = q; i < 5; i++) {
      if (arr[i] == tempp) p++;
    }
    if (p >= 3)
      k -= tempp * 3;
    else if (p == 2)
      k -= tempp * 2;
    if (k < minn) minn = k;
    q++;
    p = 0;
  }
  cout << minn;
  return 0;
}
