get_number(Number) :-
  get_string(String),
  number_string(Number, String).

main :-
  get_number(X1),
  get_number(X2),
  get_number(X3),
  get_number(X4),
  get_number(X5),
  Ans is 15 - X1 - X2 - X3 - X4 - X5,
  write(Ans).
:- main.