import java.io.*; import java.util.*; public class Main_yukicoder481 { private static Scanner sc; private static Printer pr; private static void solve() { int[] b = new int[9]; int sum = 0; for (int i = 0; i < 9; i++) { b[i] = sc.nextInt(); sum += b[i]; } pr.println(55 - sum); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }