#include <bits/stdc++.h>
using namespace std;
int t[6], cnt[111];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int sum = 0, maxV = 0, minV = INT_MAX;
  for (int i = 1; i <= 5; ++i) {
    cin >> t[i];
    sum += t[i];
    cnt[t[i]]++;
  }
  int res = sum;
  for (int i = 1; i <= 5; ++i)
    if (cnt[t[i]] >= 3)
      res = min(res, sum - t[i] * 3);
    else if (cnt[t[i]] >= 2)
      res = min(res, sum - t[i] * 2);
  cout << res << endl;
  return 0;
}
