#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> m;
  int a[5], sum = 0;
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
    m[a[i]] = 0;
    sum += a[i];
  }
  int sum2 = sum;
  for (int i = 0; i < 5; i++) m[a[i]]++;
  for (int i = 0; i < 5; i++) {
    if (m[a[i]] > 1) {
      int temp = sum - (a[i] * min(m[a[i]], 3));
      if (temp < sum2) sum2 = temp;
    }
  }
  cout << sum2;
  return 0;
}
