import math


def max_map_radius(hex_radius, height):
    """ Returns the  maximum map radius fitting in 'height' pixels
        with cells of radius 'hex_radius'.
    """
    return int( math.floor( (height - 2 * hex_radius) / (3 * hex_radius) ) )