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>
using namespace std;

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

  cout << sum / 5 << endl;
}

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++: #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;
  }
  sum  = sum/5;
  cout << a<< endl;

  return 0;
}

C++: #include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

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

C++: // 2014/07/28 Tazoe

#include <iostream>
using namespace std;

int main()
{
	int sum = 0;

	int p1;
	cin >> p1;
	if(p1<40){
		p1 = 40;
	}
	sum += p1;

	int p2;
	cin >> p2;
	if(p2<40){
		p2 = 40;
	}
	sum += p2;

	int p3;
	cin >> p3;
	if(p3<40){
		p3 = 40;
	}
	sum += p3;

	int p4;
	cin >> p4;
	if(p4<40){
		p4 = 40;
	}
	sum += p4;

	int p5;
	cin >> p5;
	if(p5<40){
		p5 = 40;
	}
	sum += p5;

	cout << sum/5 << '\n';

	return 0;
}

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

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

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

using namespace std;

/*-------------------------------*/
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b) - 1; i >= (a); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define all(i) (i).begin(),(i).end()
#define pb push_back
#define mp make_pair

typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef vector<long long> llv;
typedef vector<pint> vpint;

/*-------------------------------*/

int main(void)
{
  int a, b = 0;
  rep(i, 5){
    cin >> a;
    if (a < 40) a = 40;
    b += a;
  }

  cout << b / 5 << endl;

  return 0;
}

C++: #include <bits/stdc++.h>
#define range(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) range(i, 0, a)
using namespace std;

int main() {
    int a, sum = 0;
    rep (i, 5) cin >> a, sum += max(a, 40);
    cout << sum / 5.0 << endl;
    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\n", heikin);
	return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int score, sum = 0;

	for (int i = 0; i < 5; i++)
	{
		cin >> score;

		sum += max(score, 40);
	}

	cout << sum / 5 << endl;

	return 0;
}

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

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

int main(){
  int sum = 0;
  for (int i = 0; i < 5; i ++) {
    int t; cin >> t;
    t = max(40, t);
    sum += t;
  }

  cout << sum/5 << endl;
}

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

int main()
{
	int ans=0, a[5];
	cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
	for (int i = 0; i < 5; i++){
		if (a[i] > 40)ans += a[i];
		else ans += 40;
	}
	cout << ans / 5<<endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

int main(){
	int sum = 0, x;
	while (cin >> x) sum += min(40, x);
	cout << sum / 5 << endl;

	return 0;
}

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

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

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

int main() {
	int tensu[5], tasu = 0;

	for (int i = 0; i < 5; i++) {
		cin >> tensu[i];
		if (tensu[i] < 40)
			tensu[i] = 40;
		tasu = tasu + tensu[i];
	}

	cout << tasu / 5;

}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<long long, long long> ll_ll;
typedef pair<double, double> d_d;
typedef vector<int> Vint;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define rep2d(i, j, n) for(i = 0;i < n;++i)for(j = i + 1;j < n;++j)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << x << "\n"
#define pri2(x, y) cout << x << " " << y << "\n"
#define pri3(x, y, z) cout << x << " " << y << " " << z << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << x << "\n"
#define debug2(x, y) cout << " --- " << x << " " << y << "\n"
#define debug3(x, y, z) cout << " --- " << x << " " << y << " " << z << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j, k;
  for(int testcase = 0;testcase >= 0;testcase++){
    int5(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;
    pri((a + b + c + d + e) / 5);

/*/

//*/ break;
  }
  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;
}