Mirko's parquet floor is made of 1×1 square tiles laid in the following pattern.

The picture shows only part of the floor in an imaginary coordinate system. The floor is so large that you may assume it covers the whole plane.
Precisely, the pattern is as follows. For every integer k, the line y=k is a tile boundary. In the row k≤y≤k+1, if k is even, the tiles are [m,m+1]×[k,k+1], and if k is odd, the tiles are [m+0.5,m+1.5]×[k,k+1], for every integer m.
For his mathematics thesis, Mirko drew a rectangle on the floor with red paint. Later he found out that the paint contains a harmful chemical that destroys the parquet. Now he has to replace every tile that shares at least one point with the border of the drawn rectangle. Help Mirko: how many such tiles are there?