Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sum := 0.0
	for i := 0; i < 5; i++ {
		sc.Scan()
		s, _ := strconv.Atoi(sc.Text())
		sum += math.Max(float64(s), float64(40))
	}
	fmt.Println(int(sum / 5))

}

C++: #include<iostream>

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

	return 0;
}

C++: #include<iostream>
using namespace std;
int maxnum(int x,int y);
int main(){
    int score[5] = {0};
    int ssub = 0;
    for(int i = 0;i < 5;i++){
        cin >> score[i];
        if(score[i] < 40){
            score[i] = 40;
        }
        ssub+=score[i];
    }

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

C++: #include <iostream>

using namespace std;

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

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

using namespace std;

int main()
{
    int a = 0;
    for (int i = 0; i < 5; i++){
        int p;
        scanf("%d", &p);
        a += min(8, p / 5);
    }
    printf("%d\n", a);
    
    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;

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

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,f;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&f);
	x=(a+b+c+d+f)/5;
	printf("%d\n",x);
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int sc[5];
	int sm = 0;
	for(int i = 0;i < 5;i++){
		cin >> sc[i];
		if(sc[i] < 40){sc[i] = 40;}
		sm += sc[i];	
	}
	cout << sm/5 << endl;
	return 0;
}

C++: #include<stdio.h>

int main(){
int s=0,x;
for(int i=0;i<5;i++)
{scanf("%d",&x);if(x<40)x=40;s+=x;}

printf("%d\n",x/5);
return 0;
}

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

int main(){
  int a[5];
  int b=0;
  for(int i; i<5; i++){
    cin>>a[i];
    a[i]=a[i]/5
      if(a[i]<8){
      a[i]=8}
    b=b+a[i];
    
      }
  cout<<b<<endl;
}

C++: // JOI13-quest1.cpp : Defines the entry point for the console application.
//

#include <stdio.h>


int main(void)
{
	int temp, sum = 0;
	for (int i = 0; i < 5; i++) {
		scanf("%d", &temp);

		if (temp >= 40) {
			sum += temp;
		}
		else {
			sum += 40;
		}
	}

	printf("%d\n", sum / 5);

	return 0;
}

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

int main(){
  int a,b,c,d,e,f;
  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;
  f =(a+b+c+d+e)/5;
  cout<<f<<endl;
}

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

int main(){
  int total = 0;

  for(int i = 0; i < 5; i++){
    int x;
    cin >> x;
    total += max(40, x);
  }

  cout << total / 5 << endl;
}

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

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

C++: #include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()


int main() {
  int A, B, C, D, E, F;
  cin >> A >> B >> C >> D >> E >> F;
  int s = A + B + C + D;
  s -= min(min(A, B), min(C, D));
  cout << s + max(E, F) << "\n";
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(int i){
int s[2]={0};
for(;i<6;i++){cin >> s[0];
s[1] += s[0]>39?s[0]:40;
}
cout << s[1]/5 << endl;
return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

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

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

int main(){
  int a,s,d,f,g;
  cin>>a>>s>>d>>f>>g;

  if(a<40) a=40;
  if(s<40) s=40;
  if(d<40) d=40;
  if(f<40) f=40;
  if(g<40) g=40;

  cout << (a+s+d+f+g)/5 << endl;

  
    
  return 0;
}

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

C++: #include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int a,g=0;
	int n;
	for(int i=0;i<5;i++){
		cin>>a;
		if(a<40)g+=40;
		else g+=a;
	}
	cout<<g/5;
	

	
}

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

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

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
#define MOD 10000
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const ull B=100000007;
const int INF=1e9;
int main(){
      int ans=0,a;
      REP(i,5){
            cin>>a;
            ans+=a/5;
      }
      cout<<ans<<endl;
}

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<<endl;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
#define MOD 10000
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const ull B=100000007;
const int INF=1e9;
int main(){
      int ans=0,a;
      REP(i,5){
            cin>>a;
            if(a<40)a=40;
            ans+=a/5;
      }
      cout<<ans<<endl;
}

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;
}

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

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int average(int a,int b,int c,int d,int e){
	return (a+b+c+d+e)/5;
}
int main() {
	int i=0;
	int stu[5];
	int heikin;
	while(i<5){
		scanf("%d", &stu[i]);
		stu[i] = max(40, stu[i]);
		i++;
	}
	heikin = average(stu[0], stu[1], stu[2], stu[3], stu[4]);
	printf("%d", heikin);
	return 0;
}