import java.util.ArrayList;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		int A = 0;
		int B = 0;
		int C = 0;
		int D = 0;
		int E = 0;
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> ary = new ArrayList<Integer>();
		int i;
		for (i = 0; i < 5; i++) {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		}
		int max = 0;
		int dif=11;
		for (i = 0; i < 5; i++) {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		}
		double total=0;
		double temp=0;
		for (i = 0; i < 5; i++) {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		}
		System.out.println((int)total);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		int A = 0;
		int B = 0;
		int C = 0;
		int D = 0;
		int E = 0;
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> ary = new ArrayList<Integer>();
		int i;
		for (i = 0; i < 5; i++) {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		}
		int max = 0;
		int dif=11;
		for (i = 0; i < 5; i++) {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		}
		double total=0;
		double temp=0;
		for (i = 0; i < 5; i++) {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		}
		System.out.println((int)total);
	}
} Main public static void main(String[] args) {
		int A = 0;
		int B = 0;
		int C = 0;
		int D = 0;
		int E = 0;
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> ary = new ArrayList<Integer>();
		int i;
		for (i = 0; i < 5; i++) {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		}
		int max = 0;
		int dif=11;
		for (i = 0; i < 5; i++) {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		}
		double total=0;
		double temp=0;
		for (i = 0; i < 5; i++) {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		}
		System.out.println((int)total);
	} main {
		int A = 0;
		int B = 0;
		int C = 0;
		int D = 0;
		int E = 0;
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> ary = new ArrayList<Integer>();
		int i;
		for (i = 0; i < 5; i++) {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		}
		int max = 0;
		int dif=11;
		for (i = 0; i < 5; i++) {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		}
		double total=0;
		double temp=0;
		for (i = 0; i < 5; i++) {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		}
		System.out.println((int)total);
	} int A = 0; A 0 int B = 0; B 0 int C = 0; C 0 int D = 0; D 0 int E = 0; E 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> ary = new ArrayList<Integer>(); ary new ArrayList<Integer>() int i; i for (i = 0; i < 5; i++) {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		} i = 0; i = 0 i 0 i < 5 i 5 i++ i++ i {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		} {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		} int time = Integer.parseInt(sc.next()); time Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc ary.add(i, time) ary.add ary i time int max = 0; max 0 int dif=11; dif 11 for (i = 0; i < 5; i++) {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		} i = 0; i = 0 i 0 i < 5 i 5 i++ i++ i {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		} {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		} int remainder = ary.get(i) % 10; remainder ary.get(i) % 10 ary.get(i) ary.get ary i 10 if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			} dif > remainder&&remainder!=0 dif > remainder dif remainder remainder!=0 remainder 0 {
				dif=remainder;
				max = i;
			} dif=remainder dif remainder max = i max i double total=0; total 0 double temp=0; temp 0 for (i = 0; i < 5; i++) {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		} i = 0; i = 0 i 0 i < 5 i 5 i++ i++ i {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		} {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		} if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			} max!=i max i {
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			} temp=ary.get(i) temp ary.get(i) ary.get ary i temp=temp/10 temp temp/10 temp 10 total=total+(Math.ceil(temp)*10) total total+(Math.ceil(temp)*10) total (Math.ceil(temp)*10) Math.ceil(temp) Math.ceil Math temp 10 {
				total=total+ary.get(i);
			} total=total+ary.get(i) total total+ary.get(i) total ary.get(i) ary.get ary i System.out.println((int)total) System.out.println System.out System System.out (int)total String[] args args public class Main{
	public static void main(String[] args) {
		int A = 0;
		int B = 0;
		int C = 0;
		int D = 0;
		int E = 0;
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> ary = new ArrayList<Integer>();
		int i;
		for (i = 0; i < 5; i++) {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		}
		int max = 0;
		int dif=11;
		for (i = 0; i < 5; i++) {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		}
		double total=0;
		double temp=0;
		for (i = 0; i < 5; i++) {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		}
		System.out.println((int)total);
	}
} public class Main{
	public static void main(String[] args) {
		int A = 0;
		int B = 0;
		int C = 0;
		int D = 0;
		int E = 0;
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> ary = new ArrayList<Integer>();
		int i;
		for (i = 0; i < 5; i++) {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		}
		int max = 0;
		int dif=11;
		for (i = 0; i < 5; i++) {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		}
		double total=0;
		double temp=0;
		for (i = 0; i < 5; i++) {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		}
		System.out.println((int)total);
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		int A = 0;
		int B = 0;
		int C = 0;
		int D = 0;
		int E = 0;
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> ary = new ArrayList<Integer>();
		int i;
		for (i = 0; i < 5; i++) {
			int time = Integer.parseInt(sc.next());
			ary.add(i, time);
		}
		int max = 0;
		int dif=11;
		for (i = 0; i < 5; i++) {
			int remainder = ary.get(i) % 10;
			if (dif > remainder&&remainder!=0) {
				dif=remainder;
				max = i;
			}
		}
		double total=0;
		double temp=0;
		for (i = 0; i < 5; i++) {
			if(max!=i){
				temp=ary.get(i);
				temp=temp/10;
				total=total+(Math.ceil(temp)*10);
			}
			else{
				total=total+ary.get(i);
			}
		}
		System.out.println((int)total);
	}
}