
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int dish;
		int time = 0;
		int diff = 10;
		for(int i = 0; i < 5; i++) {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		}
		if(diff != 10) {
			time -= (10 - diff);
		}
		System.out.println(time);
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int dish;
		int time = 0;
		int diff = 10;
		for(int i = 0; i < 5; i++) {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		}
		if(diff != 10) {
			time -= (10 - diff);
		}
		System.out.println(time);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int dish;
		int time = 0;
		int diff = 10;
		for(int i = 0; i < 5; i++) {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		}
		if(diff != 10) {
			time -= (10 - diff);
		}
		System.out.println(time);
	} main {
		Scanner sc = new Scanner(System.in);
		int dish;
		int time = 0;
		int diff = 10;
		for(int i = 0; i < 5; i++) {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		}
		if(diff != 10) {
			time -= (10 - diff);
		}
		System.out.println(time);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int dish; dish int time = 0; time 0 int diff = 10; diff 10 for(int i = 0; i < 5; i++) {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		} {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		} dish = sc.nextInt() dish sc.nextInt() sc.nextInt sc if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			} dish % 10 == 0 dish % 10 dish 10 0 {
				time += dish;
			} time += dish time dish {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			} if(diff > dish % 10) {
					diff = dish % 10;
				} diff > dish % 10 diff dish % 10 dish 10 {
					diff = dish % 10;
				} diff = dish % 10 diff dish % 10 dish 10 time += dish + 10 - dish % 10 time dish + 10 - dish % 10 dish + 10 dish 10 dish % 10 dish 10 if(diff != 10) {
			time -= (10 - diff);
		} diff != 10 diff 10 {
			time -= (10 - diff);
		} time -= (10 - diff) time (10 - diff) 10 diff System.out.println(time) System.out.println System.out System System.out time String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int dish;
		int time = 0;
		int diff = 10;
		for(int i = 0; i < 5; i++) {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		}
		if(diff != 10) {
			time -= (10 - diff);
		}
		System.out.println(time);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int dish;
		int time = 0;
		int diff = 10;
		for(int i = 0; i < 5; i++) {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		}
		if(diff != 10) {
			time -= (10 - diff);
		}
		System.out.println(time);
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int dish;
		int time = 0;
		int diff = 10;
		for(int i = 0; i < 5; i++) {
			dish = sc.nextInt();
			if(dish % 10 == 0) {
				time += dish;
			} else {
				if(diff > dish % 10) {
					diff = dish % 10;
				}
				time += dish + 10 - dish % 10;
			}
		}
		if(diff != 10) {
			time -= (10 - diff);
		}
		System.out.println(time);
	}

}
