Add windows support for calculating the number of rows/columns