import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		//コマンドライン引数取得部分
		Scanner scanner = new Scanner(System.in);
		ArrayList<Integer> valList = new ArrayList<>();
		ArrayList<Integer> roundUpList = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		}
		scanner.close();

		//最大差分値
		int maxVal = 0;
		//最大差分値となる配列番号
		int maxSeqNo = 0;
		//最小提供時間
		int time = 0;

		//配列同士の差分が一番大きい配列番号を取得する
		for (int i = 0; i < valList.size(); i++) {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		}

		//最小提供時間を計算する
		for (int i = 0; i < valList.size(); i++) {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		}

		System.out.println(time);
	}

} import java.math.BigDecimal; BigDecimal java.math import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String args[]) {
		//コマンドライン引数取得部分
		Scanner scanner = new Scanner(System.in);
		ArrayList<Integer> valList = new ArrayList<>();
		ArrayList<Integer> roundUpList = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		}
		scanner.close();

		//最大差分値
		int maxVal = 0;
		//最大差分値となる配列番号
		int maxSeqNo = 0;
		//最小提供時間
		int time = 0;

		//配列同士の差分が一番大きい配列番号を取得する
		for (int i = 0; i < valList.size(); i++) {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		}

		//最小提供時間を計算する
		for (int i = 0; i < valList.size(); i++) {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		}

		System.out.println(time);
	}

} Main public static void main(String args[]) {
		//コマンドライン引数取得部分
		Scanner scanner = new Scanner(System.in);
		ArrayList<Integer> valList = new ArrayList<>();
		ArrayList<Integer> roundUpList = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		}
		scanner.close();

		//最大差分値
		int maxVal = 0;
		//最大差分値となる配列番号
		int maxSeqNo = 0;
		//最小提供時間
		int time = 0;

		//配列同士の差分が一番大きい配列番号を取得する
		for (int i = 0; i < valList.size(); i++) {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		}

		//最小提供時間を計算する
		for (int i = 0; i < valList.size(); i++) {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		}

		System.out.println(time);
	} main {
		//コマンドライン引数取得部分
		Scanner scanner = new Scanner(System.in);
		ArrayList<Integer> valList = new ArrayList<>();
		ArrayList<Integer> roundUpList = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		}
		scanner.close();

		//最大差分値
		int maxVal = 0;
		//最大差分値となる配列番号
		int maxSeqNo = 0;
		//最小提供時間
		int time = 0;

		//配列同士の差分が一番大きい配列番号を取得する
		for (int i = 0; i < valList.size(); i++) {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		}

		//最小提供時間を計算する
		for (int i = 0; i < valList.size(); i++) {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		}

		System.out.println(time);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) ArrayList<Integer> valList = new ArrayList<>(); valList new ArrayList<>() ArrayList<Integer> roundUpList = new ArrayList<>(); roundUpList new ArrayList<>() for (int i = 0; i < 5; i++) {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		} {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		} valList.add(scanner.nextInt()) valList.add valList scanner.nextInt() scanner.nextInt scanner BigDecimal bd = new BigDecimal(valList.get(i)); bd new BigDecimal(valList.get(i)) roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue()) roundUpList.add roundUpList bd.setScale(-1, BigDecimal.ROUND_UP).intValue() bd.setScale(-1, BigDecimal.ROUND_UP).intValue bd.setScale(-1, BigDecimal.ROUND_UP) bd.setScale bd -1 1 BigDecimal.ROUND_UP BigDecimal BigDecimal.ROUND_UP scanner.close() scanner.close scanner int maxVal = 0; maxVal 0 int maxSeqNo = 0; maxSeqNo 0 int time = 0; time 0 for (int i = 0; i < valList.size(); i++) {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		} int i = 0; int i = 0; i 0 i < valList.size() i valList.size() valList.size valList i++ i++ i {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		} {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		} if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			} maxVal < roundUpList.get(i) - valList.get(i) maxVal roundUpList.get(i) - valList.get(i) roundUpList.get(i) roundUpList.get roundUpList i valList.get(i) valList.get valList i {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			} maxVal = roundUpList.get(i) - valList.get(i) maxVal roundUpList.get(i) - valList.get(i) roundUpList.get(i) roundUpList.get roundUpList i valList.get(i) valList.get valList i maxSeqNo = i maxSeqNo i for (int i = 0; i < valList.size(); i++) {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		} int i = 0; int i = 0; i 0 i < valList.size() i valList.size() valList.size valList i++ i++ i {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		} {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		} if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			} i == maxSeqNo i maxSeqNo {
				time += valList.get(maxSeqNo);
			} time += valList.get(maxSeqNo) time valList.get(maxSeqNo) valList.get valList maxSeqNo {
				time += roundUpList.get(i);
			} time += roundUpList.get(i) time roundUpList.get(i) roundUpList.get roundUpList i 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 scanner = new Scanner(System.in);
		ArrayList<Integer> valList = new ArrayList<>();
		ArrayList<Integer> roundUpList = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		}
		scanner.close();

		//最大差分値
		int maxVal = 0;
		//最大差分値となる配列番号
		int maxSeqNo = 0;
		//最小提供時間
		int time = 0;

		//配列同士の差分が一番大きい配列番号を取得する
		for (int i = 0; i < valList.size(); i++) {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		}

		//最小提供時間を計算する
		for (int i = 0; i < valList.size(); i++) {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		}

		System.out.println(time);
	}

} public class Main {

	public static void main(String args[]) {
		//コマンドライン引数取得部分
		Scanner scanner = new Scanner(System.in);
		ArrayList<Integer> valList = new ArrayList<>();
		ArrayList<Integer> roundUpList = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		}
		scanner.close();

		//最大差分値
		int maxVal = 0;
		//最大差分値となる配列番号
		int maxSeqNo = 0;
		//最小提供時間
		int time = 0;

		//配列同士の差分が一番大きい配列番号を取得する
		for (int i = 0; i < valList.size(); i++) {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		}

		//最小提供時間を計算する
		for (int i = 0; i < valList.size(); i++) {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		}

		System.out.println(time);
	}

} Main
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		//コマンドライン引数取得部分
		Scanner scanner = new Scanner(System.in);
		ArrayList<Integer> valList = new ArrayList<>();
		ArrayList<Integer> roundUpList = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			valList.add(scanner.nextInt());
			BigDecimal bd = new BigDecimal(valList.get(i));
			//１の位を切り上げる
			roundUpList.add(bd.setScale(-1, BigDecimal.ROUND_UP).intValue());
		}
		scanner.close();

		//最大差分値
		int maxVal = 0;
		//最大差分値となる配列番号
		int maxSeqNo = 0;
		//最小提供時間
		int time = 0;

		//配列同士の差分が一番大きい配列番号を取得する
		for (int i = 0; i < valList.size(); i++) {
			if (maxVal < roundUpList.get(i) - valList.get(i)) {
				maxVal = roundUpList.get(i) - valList.get(i);
				maxSeqNo = i;
			}
		}

		//最小提供時間を計算する
		for (int i = 0; i < valList.size(); i++) {
			if (i == maxSeqNo) {
				time += valList.get(maxSeqNo);
			} else {
				time += roundUpList.get(i);
			}
		}

		System.out.println(time);
	}

}
