import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int abcde[]=new int[5];
		for(int i=0;i<abcde.length;i++) {
			abcde[i]=scan.nextInt();
		}
		scan.close();
		int x=0;
		int suffix=0;
		for(int i=0;i<5;i++) {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		}
		int sum=0;
		for(int i=0;i<5;i++) {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		}
		sum+=abcde[suffix];
		System.out.println(sum);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int abcde[]=new int[5];
		for(int i=0;i<abcde.length;i++) {
			abcde[i]=scan.nextInt();
		}
		scan.close();
		int x=0;
		int suffix=0;
		for(int i=0;i<5;i++) {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		}
		int sum=0;
		for(int i=0;i<5;i++) {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		}
		sum+=abcde[suffix];
		System.out.println(sum);
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int abcde[]=new int[5];
		for(int i=0;i<abcde.length;i++) {
			abcde[i]=scan.nextInt();
		}
		scan.close();
		int x=0;
		int suffix=0;
		for(int i=0;i<5;i++) {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		}
		int sum=0;
		for(int i=0;i<5;i++) {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		}
		sum+=abcde[suffix];
		System.out.println(sum);
	} main {
		Scanner scan = new Scanner(System.in);
		int abcde[]=new int[5];
		for(int i=0;i<abcde.length;i++) {
			abcde[i]=scan.nextInt();
		}
		scan.close();
		int x=0;
		int suffix=0;
		for(int i=0;i<5;i++) {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		}
		int sum=0;
		for(int i=0;i<5;i++) {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		}
		sum+=abcde[suffix];
		System.out.println(sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int abcde[]=new int[5]; abcde new int[5] 5 for(int i=0;i<abcde.length;i++) {
			abcde[i]=scan.nextInt();
		} int i=0; int i=0; i 0 i<abcde.length i abcde.length abcde abcde.length i++ i++ i {
			abcde[i]=scan.nextInt();
		} {
			abcde[i]=scan.nextInt();
		} abcde[i]=scan.nextInt() abcde[i] abcde i scan.nextInt() scan.nextInt scan scan.close() scan.close scan int x=0; x 0 int suffix=0; suffix 0 for(int i=0;i<5;i++) {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		} {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		} if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			} 10-abcde[i]%10>x && abcde[i]%10!=0 10-abcde[i]%10>x 10-abcde[i]%10 10 abcde[i]%10 abcde[i] abcde i 10 x abcde[i]%10!=0 abcde[i]%10 abcde[i] abcde i 10 0 {
				suffix=i;
				x=10-abcde[i]%10;
			} suffix=i suffix i x=10-abcde[i]%10 x 10-abcde[i]%10 10 abcde[i]%10 abcde[i] abcde i 10 int sum=0; sum 0 for(int i=0;i<5;i++) {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		} {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		} if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			} suffix!=i suffix i {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			} sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10 sum (abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10 (abcde[i]%10==0) abcde[i]%10 abcde[i] abcde i 10 0 abcde[i] abcde i abcde[i]-abcde[i]%10+10 abcde[i]-abcde[i]%10 abcde[i] abcde i abcde[i]%10 abcde[i] abcde i 10 10 sum+=abcde[suffix] sum abcde[suffix] abcde suffix System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int abcde[]=new int[5];
		for(int i=0;i<abcde.length;i++) {
			abcde[i]=scan.nextInt();
		}
		scan.close();
		int x=0;
		int suffix=0;
		for(int i=0;i<5;i++) {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		}
		int sum=0;
		for(int i=0;i<5;i++) {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		}
		sum+=abcde[suffix];
		System.out.println(sum);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int abcde[]=new int[5];
		for(int i=0;i<abcde.length;i++) {
			abcde[i]=scan.nextInt();
		}
		scan.close();
		int x=0;
		int suffix=0;
		for(int i=0;i<5;i++) {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		}
		int sum=0;
		for(int i=0;i<5;i++) {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		}
		sum+=abcde[suffix];
		System.out.println(sum);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int abcde[]=new int[5];
		for(int i=0;i<abcde.length;i++) {
			abcde[i]=scan.nextInt();
		}
		scan.close();
		int x=0;
		int suffix=0;
		for(int i=0;i<5;i++) {
			if(10-abcde[i]%10>x && abcde[i]%10!=0) {
				suffix=i;
				x=10-abcde[i]%10;
			}
		}
		int sum=0;
		for(int i=0;i<5;i++) {
			if(suffix!=i) {
				sum+=(abcde[i]%10==0)? abcde[i]:abcde[i]-abcde[i]%10+10;
			}
		}
		sum+=abcde[suffix];
		System.out.println(sum);
	}

}