#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int main() {
	int sum = 0;
	
	for_(i,0,5) {
		int in; cin >> in;
		if (in < 40) in = 40;
		sum += in;
	}
	
	cout << sum / 5 << endl;
}