x=round(solve(t(read.table("stdin"))));write(x-(-2e6>x),"",9)