with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure abc170a is
	x : Integer;
begin
	for i in 1 .. 5 loop
		get(x);
		if x /= i then
			put(Integer'Image(i));
			exit;
		end if;
	end loop;
end abc170a;