public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in).useLocale(Locale.US); double a = s.nextDouble(); double b = s.nextDouble(); double c = s.nextDouble(); double d = s.nextDouble(); double sum = 0.0; if (a > 5) sum += a; if (b > 5) sum += b; if (c > 5) sum += c; if (d > 5) sum += d; System.out.println(sum); } }