4. Let $m$ and $n$ be integers greater than $1$. Consider an $m\times n$ rectangular grid of points in the plane. Some $k$ of these points are coloured red in such a way that no three red points are the vertices of a right-angled triangle two of whose sides are parallel to the sides of the grid. Determine the greatest possible value of $k$.