OKKY 2020. 7. 13. 11:14
package com.backjun.algorithm;

import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

		ArrayList<Integer> arr = new ArrayList();
		String line;
		int cnt =0;
		while (true){
			line = br.readLine();
			int score = Integer.parseInt(line);
			if(score >= 40){
				arr.add(score);
			} else {
				arr.add(40);
			}
			cnt++;
			if(cnt==5){
				break;
			}
		}
		int result = (int)arr.stream().mapToInt(Integer::intValue).average().getAsDouble();
		System.out.println(result);

//		bw.flush();
//		bw.close();

	}
}