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