#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
const int mod = 1e9 + 7;
long long a[N], b[N], c, d, dp[N], dis;
char o;
bool mark[N], h;
string s, s1, s2;
deque<int> dq;
map<string, int> mp1;
bool vowel(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
      ch == 'y')
    return true;
  else
    return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t, n, m, k = 0, f = 0, sum = 0, ans = 0;
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
    sum += a[i];
  }
  long long mx = 0;
  sort(a, a + 5);
  for (int i = 0; i < 4; i++) {
    if (a[i] == a[i + 1]) mx = max(mx, a[i] * 2);
  }
  for (int i = 0; i < 3; i++) {
    if (a[i] == a[i + 1] && a[i] == a[i + 2]) mx = max(mx, a[i] * 3);
  }
  cout << sum - mx;
}
