def bedroom_count(sfmain, site):
    """ (float, float) -> int

    Return 3, 2, or 1 indicating the number of bedrooms a backyard house could have
    based on the size of the lot (site), and the size of the main house (sfmain).
    The area of the main structure plus the backyard house should be less than
    the size of the site.  The typical backyard house area for a 3 br
    is 1200 sf, 2 br is 700 sf, 1 br is 400 sf.

    >>> bedroom_count(2400,7200)
    3
    >>> bedroom_count(700, 5000)
    0
    """
    if sfmain >= 2400 and (sfmain + 1200)*2 <= site:
        br = 3
        return br
    elif sfmain >= 1400 and (sfmain + 700)*2 <= site:
        br = 2
        return br
    elif sfmain >= 800 and (sfmain + 400)*2 <= site:
        br = 1
        return br
    else:
        br = 0
    return br