Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)
	sum := 0
	for i := 0; i < 5; i++ {
		score := nextInt()
		if score < 40 {
			sum += 40
		} else {
			sum += score
		}
	}
	// fmt.Println(sum)
	fmt.Println(sum / 5)
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>

using namespace std;

int main (void)
{
	int a[5],con;

	for (int i = 0; i < 5; i++)
	{
		cin >> a[i];
		if (a[i] < 40)
		{
			a[i] = 0;
			a[i] = 40;
		}
		else
		{
		}
		con += a[i];
	}

	cout << con / 5 << endl;
return 0;
}

C++: #include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <queue>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rrep(i,n) for(int i = 1; i <= n; ++i)
using namespace std;
typedef pair<int,int> P;
const int INF = 1000000000;



int main(){
	int a,b=0;
	rep(i,5){
	scanf("%d",&a);
	b+=(a>=40?a:40);
}
	printf("%d\n",b/5);
	
	return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int score[5];
	int sum = 0;
	for(int i = 0; i < 5; ++i)
	{
		cin >> score[i];
		if(score[i] >= 40)
		{
			sum += score[i];
		}
		else
		{
			sum += 40;
		}
	}
	cout << sum / 5 << endl;
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
using namespace std;
int main()
{
	int a,b,c,d,e;
	cin >> a;if(a<40)a=40;
	cin >> b;if(b<40)b=40;
	cin >> c;if(c<40)c=40;
	cin >> d;if(d<40)d=40;
	cin >> e;if(e<40)e=40;
	int sum=a+b+c+d+e;
	cout << sum/5 << endl;
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <string>
#include <functional>
#include <math.h>
#include <utility>
using namespace std;
int main()
{
	int sum=0;
	for(int i=0;i<5;i++){
		int tmp;cin>>tmp;
		sum+=max(40,tmp);
	}
	cout<<sum/5<<endl;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int n;
    int ans = 0;

    for (int i = 0; i < 5; i++) {
        cin >> n;
        n < 40 ? ans += 40 : ans += n;
    }

    cout << ans / 5 << endl;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	if(a<40)a=40;
	if(b<40)b=40;
	if(c<40)c=40;
	if(d<40)d=40;
	if(e<40)e=40;
	cout<<(a+b+c+d+e)/5<<endl;
	return 0;
	}

C++: #include<stdio.h>
int main()
{
int kimatsu[5], goukei = 0,a,i;
	for (i = 0; i < 5; i++)
	{
		scanf("%d", &kimatsu[i]);
		for (a = 40; kimatsu[i] < a;)
		{
			kimatsu[i] = 40;
		}
	}
	goukei =( kimatsu[0] + kimatsu[1] + kimatsu[2] + kimatsu[3] + kimatsu[4])/5;
	printf("%d",goukei);

	return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
  int stu[5];
  int ava;
  for(int i=0;i<5;i++){
    cin >> stu[i];
    if(stu[i] < 40){
      stu[i] = 40;
    }
    ava += stu[i];
  }
  ava = ava / 5;
  cout << ava << endl;
}

C++: #include <iostream>

using namespace std;

int main(void){

  int score, sum = 0;
  for(int i = 0; i < 5; i++){
    cin >> score;
    if(score < 40)	score = 40;
    sum += score;
  }
  cout << sum/5;

  return 0;
}

C++: #include <cstdio>

int main(){
	int ave = 0;
	for(int i = 0; i < 5; i++){
		int p; scanf("%d", &p);
		if(p < 40) p = 40;
		ave += p;
	}
	printf("%d\n", ave/5);
}

C++: #include<stdio.h>
int main(){
	int x[5],i,a=0;
	scanf("%d",&x[0]);
	scanf("%d",&x[1]);
	scanf("%d",&x[2]);
	scanf("%d",&x[3]);
	scanf("%d",&x[4]);
	for(i=0;i<5;i++){
		if(x[i]<40)
		x[i]=40;
		a+=x[i];
	}
	printf("%d\n",a/5);
return 0;
}

C++: #include <stdio.h>

int main(void) {
	int i, x, sum = 0;
	for(i = 0; i < 5; ++i) {
		scanf("%d", &x);
		if(x < 40) {
			sum += 40;
		} else {
			sum += x;
		}
	}
	printf("%d\n", sum / 5);
	return 0;
}

C++: #include<iostream>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

int main() {
  int a[5];
  rep (i, 5) cin >> a[i];
  rep (i, 5) if (a[i] < 40) a[i] = 40;
  int sum = 0;
  rep (i, 5) sum += a[i];
  cout << sum / 5 << endl;
}

C++: #include <iostream>
using namespace std;

int main() {
	int a, b, c, d, e, sum, avg;
	cin >> a >> b >> c >> d >> e;
	if(a<=40) a=40;
	if(b<=40) b=40;
	if(c<=40) c=40;
	if(d<=40) d=40;
	if(e<=40) e=40;
	sum = a+b+c+d+e;
	avg = sum/5;
	cout << avg << endl;
	return 0;
}

C++: #include<iosteam>
using namespase std;

int main(){

	int a,b,c,d,e;

cin >> a >> b >> c >> d >> e;

	int m=0;

	if( a<40 ){
		m += 40;	
}
	else{
		m += a;
	}
	if( b<40 ){
		m += 40;
}
	else{
		m += b;
	}
	if( c<40 ){
		m += 40;
}
	else{
		m += c;
}
	if( d<40 ){
		m += 40;
}
	else{
		m += d;
}
	if( e<40 ){
		m += 40;
}
	else{
		m += e;
}


cout << m/5 << endl;

return 0;


}

C++: public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] score = new int [5];
		int i, sum = 0;
		for(i = 0; i < 5; i++){
			score[i] = sc.nextInt();
			if(score[i] < 40){
				score[i] = 40;
			}
		}
		//System.out.printf("%d\n", score[0]);
		for(int k = 0; k < 5; k++){
			sum = sum + score[k];
		}
		System.out.printf("%d\n", sum / 5);
	}

}

C++: #include<iostream>
using namespace std;

int main(){
	int a;
	int S;
	for(int i=0;i<5;i++){
		cin>>a;
		if(a<40)
			a=40;
		S+=a;		
	}
	S=S/5;	
	cout<<S;
}

C++: #include <iostream>

using namespace std;

int main(void){

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

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	vl a(5);
	rep(i,5){cin>>a[i];chmax(a[i],40ll);}
	puta(sum(a)/5);
	return 0;
}