#include <stdio.h>
int main(void) {
int a, b, c, d, e, min, max, n;
scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
min = a;
if (a <= b && a <= c && a <= d && a <= e)
min = a;
else if (b <= a && b <= c && b <= d && b <= e)
min = b;
else if (c <= b && c <= a && c <= d && c <= e)
min = c;
else if (d <= b && d <= c && d <= a && d <= e)
min = d;
else if (e <= b && e <= c && e <= d && e <= a)
min = e;
max = a;
if (max < b) max = b;
if (max < c) max = c;
if (max < d) max = d;
if (max < e) max = e;
n = max +min;
printf("%d", n);
return 0;
}