with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure abc170a is
	x   : Integer;
	tmp : Integer;
begin
	get(x);
	get(tmp);
	x := x + tmp;
	get(tmp);
	x := x + tmp;
	get(tmp);
	x := x + tmp;
	get(tmp);
	x := x + tmp;
	put(Integer'Image(15-x));
end abc170a;