#include <bits/stdc++.h>
using namespace std;
int b[105];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int sum = 0;
  for (int i = 1; i <= 5; i++) {
    int a;
    cin >> a;
    sum += a;
    ++b[a];
  }
  int ans = 100005;
  for (int i = 1; i <= 100; i++) {
    if (b[i] >= 2) {
      ans = min(ans, sum - i * min(b[i], 3));
    }
  }
  cout << min(sum, ans);
  return 0;
}
