Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

func main() {
	sc.Split(bufio.ScanWords)

	sum := 0
	for i := 0; i < 5; i++ {
		x := nextInt()
		if x < 40 {
			sum += 40
		} else {
			sum += x
		}
	}
	fmt.Println(sum / 5)
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
#include <numeric>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    vector<int> v(5);
    for (auto &&i : v) {
        cin >> i;
        if(i < 40) i = 40;
    }
    cout << accumulate(v.begin(), v.end(), 0)/5 << "\n";
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int a=0,b;
    for(int i=0;i<5;++i){
        cin>>b;
        a+=b<40?40:b;
    }
    cout<<a/5<<endl;
    return 0;
}

C++: #include<iostream>
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++: 
//  q1.cpp(2014/10/12-)


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>

using namespace std;


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

C++: #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
	int a[10];
	int sum = 0;
	for (int i = 0; i < 5; i++) {
		cin >> a[i];
		if (a[i] < 40)a[i] = 40;
		sum += a[i];
	}
	cout << sum << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
  int data;
  int sum = 0;
  for(int i = 0; i < 5; i++) {
    cin >> data;
    if(data < 40)data = 40;
    sum += data;
  }
  cout << sum / 5 << endl;
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <map>
#include <functional>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1);

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

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

int main() {
  int T, J, S, Y, H;
  cin >> T >> J >> S >> Y >> H;

  if(T<40){
  T = 40;
  }
  if(J<40){
  J = 40;
  }
  if(S<40){
  S = 40;
  }
  if(Y<40){
  Y = 40;
  }
  if(H<40){
  H = 40;
  }

 cout << (T + J + S + Y + H)/5 << endl;

return 0;
}

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

int main() {
	int t,z,s,y,h;
	cin>>t>>z>>s>>y>>h;
	if(t<40){
		t=40;
	}
	if(z<40){
			z=40;
		}
	if(s<40){
			s=40;
		}
	if(y<40){
			y=40;
		}
	if(h<40){
			h=40;
		}
	cout<<(t+z+s+y+h)/5<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
	int score, total;

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

	return 0;
}

C++: #include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

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

C++: #include <iostream>
using namespace std;
int main(){
	int a,b,c,d,e,x,y;
	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;
	}
	x=a+b+c+d+e;
	y=x/5;
	cout << y << endl;
}

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

int main(){
	int a[5];
	for (int i = 0; i < 5; i++){
		scanf("%d", &a[i]);
	}
	for (int i = 0; i < 5; i++){
		if (a[i] < 40){
			a[i] = 40;
		}
	}
	printf("%d\n", (a[0] + a[1] + a[2] + a[3] + a[4]) / 5);

	return 0;
}

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

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

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 <iostream>
#include <numeric>

#define N 5
#define min_score 40

using namespace std;

int main()
{
  int scores[N];

  for(int i = 0; i < N; i += 1){
    cin >> scores[i];
    scores[i] = max(scores[i], min_score);
  }

  cout << (accumulate(scores, scores+N, 0)/N) << endl;

  return 0;
}

C++: #include<stdio.h>
int s,a;
int main(){for(;scanf("%d",&a)!=EOF;)s+=(a<40)?8:a/5;printf("%d\n",s);}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
int main(void)
{
	int a[5]={0};
	for(int i=0;i<5;i++)
	{
		scanf("%d",&a[i]);
		if(a[i]<40){
			a[i]=40;
		}
	}
	printf("%d\n",(a[0]+a[1]+a[2]+a[3]+a[4])/5);
	return 0;
}
//13:23.577 clear!!

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),n.end()
#define PI acos(-1)
using namespace std;
int main(){
  int sum=0;
  rep(i,5){
    int tmp;
    cin>>tmp;
    if(tmp<40)tmp=40;
    sum+=tmp;
  }
  cout<<sum/5<<endl;

}
/*int main(){
  int sum=0;
  int tmp;
  rep(i,5){
    cin>>tmp;
    if(tmp>=40)sum+=tmp;
    else sum+=40;
  }
  cout<<sum/5<<endl;


}
*/

C++: #include <iostream>
#include <vector>
#include <string>
#include <utility>

using namespace std;

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

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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

const int    INF = 1000000000;
const ll     MOD = 1000000007LL;
const double EPS = 1E-12;

int d;
int res;

int main()
{
  rep(i, 5){
    cin >> d;
    res += max(d, 40);
  }

  cout << res / 5 << endl;

  return 0;
}