On a chessboard, n white and n black rooks are arranged so that the rooks of different colours cannot capture one another. Find the greatest possible value of n.