#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[5];
  int sum = 0;
  for (int i = 0; i < 5; i++) cin >> a[i];
  sort(a, a + 5);
  int b[2];
  int l = 0;
  b[0] = 0;
  b[1] = 0;
  for (int i = 0; i < 5; i++) {
    if (a[i] != a[i + 1]) {
      sum += a[i];
    } else {
      b[l] += 2 * a[i];
      i++;
      if (a[i] == a[i + 1]) {
        b[l] += a[i];
        i++;
      }
      l++;
    }
  }
  if (b[0] > b[1])
    sum += b[1];
  else
    sum += b[0];
  cout << sum;
}
