print((function (r) for i=1,9 do if i ~= io.stdin:read("*n") then r = i break end end return r end)(10))