let read_ints () =
  let str = read_line() in
  List.map (fun x -> int_of_string x) (Str.split (Str.regexp " +") str)
;;

let rec sum lst =
  match lst with
  |[] -> 0
  |h :: t -> h + sum t
;;

let x = read_ints() in
print_endline (string_of_int (15 - sum x))
