import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int Menu[] = new int[5];
        int min = 9; 
        int last = 0; 
        int i = 0;
        int count = 0; 
		// 数の入力
		for(i = 0;i < 5;i++){
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        }
      	for(i = 0;i < 5;i++){
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        }
		count += Menu[last];
    System.out.println(count);            
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int Menu[] = new int[5];
        int min = 9; 
        int last = 0; 
        int i = 0;
        int count = 0; 
		// 数の入力
		for(i = 0;i < 5;i++){
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        }
      	for(i = 0;i < 5;i++){
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        }
		count += Menu[last];
    System.out.println(count);            
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int Menu[] = new int[5];
        int min = 9; 
        int last = 0; 
        int i = 0;
        int count = 0; 
		// 数の入力
		for(i = 0;i < 5;i++){
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        }
      	for(i = 0;i < 5;i++){
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        }
		count += Menu[last];
    System.out.println(count);            
    } main {
		Scanner sc = new Scanner(System.in);
        int Menu[] = new int[5];
        int min = 9; 
        int last = 0; 
        int i = 0;
        int count = 0; 
		// 数の入力
		for(i = 0;i < 5;i++){
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        }
      	for(i = 0;i < 5;i++){
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        }
		count += Menu[last];
    System.out.println(count);            
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int Menu[] = new int[5]; Menu new int[5] 5 int min = 9; min 9 int last = 0; last 0 int i = 0; i 0 int count = 0; count 0 for(i = 0;i < 5;i++){
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        } i = 0; i = 0 i 0 i < 5 i 5 i++ i++ i {
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        } {
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        } Menu[i] = sc.nextInt() Menu[i] Menu i sc.nextInt() sc.nextInt sc if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          } Menu[i] % 10 <= min && Menu[i] % 10 != 0 Menu[i] % 10 <= min Menu[i] % 10 Menu[i] Menu i 10 min Menu[i] % 10 != 0 Menu[i] % 10 Menu[i] Menu i 10 0 {
            min = Menu[i] % 10;
            last = i;
          } min = Menu[i] % 10 min Menu[i] % 10 Menu[i] Menu i 10 last = i last i for(i = 0;i < 5;i++){
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        } i = 0; i = 0 i 0 i < 5 i 5 i++ i++ i {
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        } {
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        } if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          } i != last i last {
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          } if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            } Menu[i] % 10 == 0 Menu[i] % 10 Menu[i] Menu i 10 0 {
              count += Menu[i]; 
            } count += Menu[i] count Menu[i] Menu i {
              count += (Menu[i] / 10 + 1) * 10;
            } count += (Menu[i] / 10 + 1) * 10 count (Menu[i] / 10 + 1) * 10 (Menu[i] / 10 + 1) Menu[i] / 10 Menu[i] Menu i 10 1 10 count += Menu[last] count Menu[last] Menu last System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int Menu[] = new int[5];
        int min = 9; 
        int last = 0; 
        int i = 0;
        int count = 0; 
		// 数の入力
		for(i = 0;i < 5;i++){
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        }
      	for(i = 0;i < 5;i++){
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        }
		count += Menu[last];
    System.out.println(count);            
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int Menu[] = new int[5];
        int min = 9; 
        int last = 0; 
        int i = 0;
        int count = 0; 
		// 数の入力
		for(i = 0;i < 5;i++){
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        }
      	for(i = 0;i < 5;i++){
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        }
		count += Menu[last];
    System.out.println(count);            
    }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int Menu[] = new int[5];
        int min = 9; 
        int last = 0; 
        int i = 0;
        int count = 0; 
		// 数の入力
		for(i = 0;i < 5;i++){
          Menu[i] = sc.nextInt();
          if(Menu[i] % 10 <= min && Menu[i] % 10 != 0 ){
            min = Menu[i] % 10;
            last = i;
          }
        }
      	for(i = 0;i < 5;i++){
          if(i != last){
            if(Menu[i] % 10 == 0){
              count += Menu[i]; 
            }else{
              count += (Menu[i] / 10 + 1) * 10;
            }
          }
        }
		count += Menu[last];
    System.out.println(count);            
    }
}