import java.util.*;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a[]=new int[5];
		int b[]=new int[5];
		int total=0;
		int min=10;

		for(int i=0;i<5;i++){
			a[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++){
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		}

		for(int i=0;i<5;i++){
			total+=b[i];
		}
		System.out.println(total-(10-min));

	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a[]=new int[5];
		int b[]=new int[5];
		int total=0;
		int min=10;

		for(int i=0;i<5;i++){
			a[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++){
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		}

		for(int i=0;i<5;i++){
			total+=b[i];
		}
		System.out.println(total-(10-min));

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a[]=new int[5];
		int b[]=new int[5];
		int total=0;
		int min=10;

		for(int i=0;i<5;i++){
			a[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++){
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		}

		for(int i=0;i<5;i++){
			total+=b[i];
		}
		System.out.println(total-(10-min));

	} main {
		Scanner sc = new Scanner(System.in);

		int a[]=new int[5];
		int b[]=new int[5];
		int total=0;
		int min=10;

		for(int i=0;i<5;i++){
			a[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++){
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		}

		for(int i=0;i<5;i++){
			total+=b[i];
		}
		System.out.println(total-(10-min));

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a[]=new int[5]; a new int[5] 5 int b[]=new int[5]; b new int[5] 5 int total=0; total 0 int min=10; min 10 for(int i=0;i<5;i++){
			a[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			a[i]=sc.nextInt();
		} {
			a[i]=sc.nextInt();
		} a[i]=sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc for(int i=0;i<5;i++){
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		} {
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		} if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=1 && a[i]<=10 a[i]>=1 a[i] a i 1 a[i]<=10 a[i] a i 10 {
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			} b[i]=10 b[i] b i 10 if(min>a[i]){
					min=a[i];
				} min>a[i] min a[i] a i {
					min=a[i];
				} min=a[i] min a[i] a i if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=11 && a[i]<=20 a[i]>=11 a[i] a i 11 a[i]<=20 a[i] a i 20 {
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			} b[i]=20 b[i] b i 20 if(min>a[i]-10){
					min=a[i]-10;
				} min>a[i]-10 min a[i]-10 a[i] a i 10 {
					min=a[i]-10;
				} min=a[i]-10 min a[i]-10 a[i] a i 10 if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=21 && a[i]<=30 a[i]>=21 a[i] a i 21 a[i]<=30 a[i] a i 30 {
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			} b[i]=30 b[i] b i 30 if(min>a[i]-20){
					min=a[i]-20;
				} min>a[i]-20 min a[i]-20 a[i] a i 20 {
					min=a[i]-20;
				} min=a[i]-20 min a[i]-20 a[i] a i 20 if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=31 && a[i]<=40 a[i]>=31 a[i] a i 31 a[i]<=40 a[i] a i 40 {
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			} b[i]=40 b[i] b i 40 if(min>a[i]-30){
					min=a[i]-30;
				} min>a[i]-30 min a[i]-30 a[i] a i 30 {
					min=a[i]-30;
				} min=a[i]-30 min a[i]-30 a[i] a i 30 if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=41 && a[i]<=50 a[i]>=41 a[i] a i 41 a[i]<=50 a[i] a i 50 {
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			} b[i]=50 b[i] b i 50 if(min>a[i]-40){
					min=a[i]-40;
				} min>a[i]-40 min a[i]-40 a[i] a i 40 {
					min=a[i]-40;
				} min=a[i]-40 min a[i]-40 a[i] a i 40 if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=51 && a[i]<=60 a[i]>=51 a[i] a i 51 a[i]<=60 a[i] a i 60 {
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			} b[i]=60 b[i] b i 60 if(min>a[i]-50){
					min=a[i]-50;
				} min>a[i]-50 min a[i]-50 a[i] a i 50 {
					min=a[i]-50;
				} min=a[i]-50 min a[i]-50 a[i] a i 50 if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=61 && a[i]<=70 a[i]>=61 a[i] a i 61 a[i]<=70 a[i] a i 70 {
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			} b[i]=70 b[i] b i 70 if(min>a[i]-60){
					min=a[i]-60;
				} min>a[i]-60 min a[i]-60 a[i] a i 60 {
					min=a[i]-60;
				} min=a[i]-60 min a[i]-60 a[i] a i 60 if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=71 && a[i]<=80 a[i]>=71 a[i] a i 71 a[i]<=80 a[i] a i 80 {
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			} b[i]=80 b[i] b i 80 if(min>a[i]-70){
					min=a[i]-70;
				} min>a[i]-70 min a[i]-70 a[i] a i 70 {
					min=a[i]-70;
				} min=a[i]-70 min a[i]-70 a[i] a i 70 if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=81 && a[i]<=90 a[i]>=81 a[i] a i 81 a[i]<=90 a[i] a i 90 {
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			} b[i]=90 b[i] b i 90 if(min>a[i]-80){
					min=a[i]-80;
				} min>a[i]-80 min a[i]-80 a[i] a i 80 {
					min=a[i]-80;
				} min=a[i]-80 min a[i]-80 a[i] a i 80 if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=91 && a[i]<=100 a[i]>=91 a[i] a i 91 a[i]<=100 a[i] a i 100 {
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			} b[i]=100 b[i] b i 100 if(min>a[i]-90){
					min=a[i]-90;
				} min>a[i]-90 min a[i]-90 a[i] a i 90 {
					min=a[i]-90;
				} min=a[i]-90 min a[i]-90 a[i] a i 90 if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=101 && a[i]<=110 a[i]>=101 a[i] a i 101 a[i]<=110 a[i] a i 110 {
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			} b[i]=110 b[i] b i 110 if(min>a[i]-100){
					min=a[i]-100;
				} min>a[i]-100 min a[i]-100 a[i] a i 100 {
					min=a[i]-100;
				} min=a[i]-100 min a[i]-100 a[i] a i 100 if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=111 && a[i]<=120 a[i]>=111 a[i] a i 111 a[i]<=120 a[i] a i 120 {
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			} b[i]=120 b[i] b i 120 if(min>a[i]-110){
					min=a[i]-110;
				} min>a[i]-110 min a[i]-110 a[i] a i 110 {
					min=a[i]-110;
				} min=a[i]-110 min a[i]-110 a[i] a i 110 if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} a[i]>=121 && a[i]<=130 a[i]>=121 a[i] a i 121 a[i]<=130 a[i] a i 130 {
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			} b[i]=130 b[i] b i 130 if(min>a[i]-120){
					min=a[i]-120;
				} min>a[i]-120 min a[i]-120 a[i] a i 120 {
					min=a[i]-120;
				} min=a[i]-120 min a[i]-120 a[i] a i 120 for(int i=0;i<5;i++){
			total+=b[i];
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			total+=b[i];
		} {
			total+=b[i];
		} total+=b[i] total b[i] b i System.out.println(total-(10-min)) System.out.println System.out System System.out total-(10-min) total (10-min) 10 min String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a[]=new int[5];
		int b[]=new int[5];
		int total=0;
		int min=10;

		for(int i=0;i<5;i++){
			a[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++){
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		}

		for(int i=0;i<5;i++){
			total+=b[i];
		}
		System.out.println(total-(10-min));

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a[]=new int[5];
		int b[]=new int[5];
		int total=0;
		int min=10;

		for(int i=0;i<5;i++){
			a[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++){
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		}

		for(int i=0;i<5;i++){
			total+=b[i];
		}
		System.out.println(total-(10-min));

	}
} Main
import java.util.*;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a[]=new int[5];
		int b[]=new int[5];
		int total=0;
		int min=10;

		for(int i=0;i<5;i++){
			a[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++){
			if(a[i]>=1 && a[i]<=10){
				b[i]=10;
				if(min>a[i]){
					min=a[i];
				}
			}else if(a[i]>=11 && a[i]<=20){
				b[i]=20;
				if(min>a[i]-10){
					min=a[i]-10;
				}
			}else if(a[i]>=21 && a[i]<=30){
				b[i]=30;
				if(min>a[i]-20){
					min=a[i]-20;
				}
			}else if(a[i]>=31 && a[i]<=40){
				b[i]=40;
				if(min>a[i]-30){
					min=a[i]-30;
				}

			}else if(a[i]>=41 && a[i]<=50){
				b[i]=50;
				if(min>a[i]-40){
					min=a[i]-40;
				}
			}else if(a[i]>=51 && a[i]<=60){
				b[i]=60;
				if(min>a[i]-50){
					min=a[i]-50;
				}
			}else if(a[i]>=61 && a[i]<=70){
				b[i]=70;
				if(min>a[i]-60){
					min=a[i]-60;
				}
			}else if(a[i]>=71 && a[i]<=80){
				b[i]=80;
				if(min>a[i]-70){
					min=a[i]-70;
				}
			}else if(a[i]>=81 && a[i]<=90){
				b[i]=90;
				if(min>a[i]-80){
					min=a[i]-80;
				}
			}else if(a[i]>=91 && a[i]<=100){
				b[i]=100;
				if(min>a[i]-90){
					min=a[i]-90;
				}
			}else if(a[i]>=101 && a[i]<=110){
				b[i]=110;
				if(min>a[i]-100){
					min=a[i]-100;
				}
			}else if(a[i]>=111 && a[i]<=120){
				b[i]=120;
				if(min>a[i]-110){
					min=a[i]-110;
				}
			}else if(a[i]>=121 && a[i]<=130){
				b[i]=130;
				if(min>a[i]-120){
					min=a[i]-120;
				}
			}
		}

		for(int i=0;i<5;i++){
			total+=b[i];
		}
		System.out.println(total-(10-min));

	}
}
