import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();

		int result =0;
		int minTime =10;

		int aResult = result(a);
		int bResult = result(b);
		int cResult = result(c);
		int dResult = result(d);
		int eResult = result(e);

		minTime = Math.min(minTime, a%10==0?10:a%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, b%10==0?10:b%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, c%10==0?10:c%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, d%10==0?10:d%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, e%10==0?10:e%10);
		// System.out.println(minTime);
		if(minTime==10){
			minTime=10;
		}

		result += aResult;
		// System.out.println(result);
		result += bResult;
		// System.out.println(result);
		result += cResult;
		// System.out.println(result);
		result += dResult;
		// System.out.println(result);
		result += eResult;
		// System.out.println(result);
		result += minTime-10;
		System.out.println(result);

	}

	private static int result(int a) {
	if(a%10!=0){
		return a/10 *10 +10;
	}
	return a;
	}
}
 import java.util.*; util.* java import java.math.*; math.* java import java.lang.*; lang.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();

		int result =0;
		int minTime =10;

		int aResult = result(a);
		int bResult = result(b);
		int cResult = result(c);
		int dResult = result(d);
		int eResult = result(e);

		minTime = Math.min(minTime, a%10==0?10:a%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, b%10==0?10:b%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, c%10==0?10:c%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, d%10==0?10:d%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, e%10==0?10:e%10);
		// System.out.println(minTime);
		if(minTime==10){
			minTime=10;
		}

		result += aResult;
		// System.out.println(result);
		result += bResult;
		// System.out.println(result);
		result += cResult;
		// System.out.println(result);
		result += dResult;
		// System.out.println(result);
		result += eResult;
		// System.out.println(result);
		result += minTime-10;
		System.out.println(result);

	}

	private static int result(int a) {
	if(a%10!=0){
		return a/10 *10 +10;
	}
	return a;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();

		int result =0;
		int minTime =10;

		int aResult = result(a);
		int bResult = result(b);
		int cResult = result(c);
		int dResult = result(d);
		int eResult = result(e);

		minTime = Math.min(minTime, a%10==0?10:a%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, b%10==0?10:b%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, c%10==0?10:c%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, d%10==0?10:d%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, e%10==0?10:e%10);
		// System.out.println(minTime);
		if(minTime==10){
			minTime=10;
		}

		result += aResult;
		// System.out.println(result);
		result += bResult;
		// System.out.println(result);
		result += cResult;
		// System.out.println(result);
		result += dResult;
		// System.out.println(result);
		result += eResult;
		// System.out.println(result);
		result += minTime-10;
		System.out.println(result);

	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();

		int result =0;
		int minTime =10;

		int aResult = result(a);
		int bResult = result(b);
		int cResult = result(c);
		int dResult = result(d);
		int eResult = result(e);

		minTime = Math.min(minTime, a%10==0?10:a%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, b%10==0?10:b%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, c%10==0?10:c%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, d%10==0?10:d%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, e%10==0?10:e%10);
		// System.out.println(minTime);
		if(minTime==10){
			minTime=10;
		}

		result += aResult;
		// System.out.println(result);
		result += bResult;
		// System.out.println(result);
		result += cResult;
		// System.out.println(result);
		result += dResult;
		// System.out.println(result);
		result += eResult;
		// System.out.println(result);
		result += minTime-10;
		System.out.println(result);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc int e = sc.nextInt(); e sc.nextInt() sc.nextInt sc int result =0; result 0 int minTime =10; minTime 10 int aResult = result(a); aResult result(a) result a int bResult = result(b); bResult result(b) result b int cResult = result(c); cResult result(c) result c int dResult = result(d); dResult result(d) result d int eResult = result(e); eResult result(e) result e minTime = Math.min(minTime, a%10==0?10:a%10) minTime Math.min(minTime, a%10==0?10:a%10) Math.min Math minTime a%10==0?10:a%10 a%10==0 a%10 a 10 0 10 a%10 a 10 minTime = Math.min(minTime, b%10==0?10:b%10) minTime Math.min(minTime, b%10==0?10:b%10) Math.min Math minTime b%10==0?10:b%10 b%10==0 b%10 b 10 0 10 b%10 b 10 minTime = Math.min(minTime, c%10==0?10:c%10) minTime Math.min(minTime, c%10==0?10:c%10) Math.min Math minTime c%10==0?10:c%10 c%10==0 c%10 c 10 0 10 c%10 c 10 minTime = Math.min(minTime, d%10==0?10:d%10) minTime Math.min(minTime, d%10==0?10:d%10) Math.min Math minTime d%10==0?10:d%10 d%10==0 d%10 d 10 0 10 d%10 d 10 minTime = Math.min(minTime, e%10==0?10:e%10) minTime Math.min(minTime, e%10==0?10:e%10) Math.min Math minTime e%10==0?10:e%10 e%10==0 e%10 e 10 0 10 e%10 e 10 if(minTime==10){
			minTime=10;
		} minTime==10 minTime 10 {
			minTime=10;
		} minTime=10 minTime 10 result += aResult result aResult result += bResult result bResult result += cResult result cResult result += dResult result dResult result += eResult result eResult result += minTime-10 result minTime-10 minTime 10 System.out.println(result) System.out.println System.out System System.out result String[] args args private static int result(int a) {
	if(a%10!=0){
		return a/10 *10 +10;
	}
	return a;
	} result {
	if(a%10!=0){
		return a/10 *10 +10;
	}
	return a;
	} if(a%10!=0){
		return a/10 *10 +10;
	} a%10!=0 a%10 a 10 0 {
		return a/10 *10 +10;
	} return a/10 *10 +10; a/10 *10 +10 a/10 *10 a/10 a 10 10 10 return a; a int a a public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();

		int result =0;
		int minTime =10;

		int aResult = result(a);
		int bResult = result(b);
		int cResult = result(c);
		int dResult = result(d);
		int eResult = result(e);

		minTime = Math.min(minTime, a%10==0?10:a%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, b%10==0?10:b%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, c%10==0?10:c%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, d%10==0?10:d%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, e%10==0?10:e%10);
		// System.out.println(minTime);
		if(minTime==10){
			minTime=10;
		}

		result += aResult;
		// System.out.println(result);
		result += bResult;
		// System.out.println(result);
		result += cResult;
		// System.out.println(result);
		result += dResult;
		// System.out.println(result);
		result += eResult;
		// System.out.println(result);
		result += minTime-10;
		System.out.println(result);

	}

	private static int result(int a) {
	if(a%10!=0){
		return a/10 *10 +10;
	}
	return a;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();

		int result =0;
		int minTime =10;

		int aResult = result(a);
		int bResult = result(b);
		int cResult = result(c);
		int dResult = result(d);
		int eResult = result(e);

		minTime = Math.min(minTime, a%10==0?10:a%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, b%10==0?10:b%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, c%10==0?10:c%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, d%10==0?10:d%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, e%10==0?10:e%10);
		// System.out.println(minTime);
		if(minTime==10){
			minTime=10;
		}

		result += aResult;
		// System.out.println(result);
		result += bResult;
		// System.out.println(result);
		result += cResult;
		// System.out.println(result);
		result += dResult;
		// System.out.println(result);
		result += eResult;
		// System.out.println(result);
		result += minTime-10;
		System.out.println(result);

	}

	private static int result(int a) {
	if(a%10!=0){
		return a/10 *10 +10;
	}
	return a;
	}
} Main
import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();

		int result =0;
		int minTime =10;

		int aResult = result(a);
		int bResult = result(b);
		int cResult = result(c);
		int dResult = result(d);
		int eResult = result(e);

		minTime = Math.min(minTime, a%10==0?10:a%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, b%10==0?10:b%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, c%10==0?10:c%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, d%10==0?10:d%10);
		// System.out.println(minTime);
		minTime = Math.min(minTime, e%10==0?10:e%10);
		// System.out.println(minTime);
		if(minTime==10){
			minTime=10;
		}

		result += aResult;
		// System.out.println(result);
		result += bResult;
		// System.out.println(result);
		result += cResult;
		// System.out.println(result);
		result += dResult;
		// System.out.println(result);
		result += eResult;
		// System.out.println(result);
		result += minTime-10;
		System.out.println(result);

	}

	private static int result(int a) {
	if(a%10!=0){
		return a/10 *10 +10;
	}
	return a;
	}
}

