Rook

It can be seen that the answer is $$$n+m-2$$$.