# Arup Guha
# 1/5/2013
# Solution to Programming Knights Practice Program Chapter 2 Problem 6
# Computers R Us

LEVEL_ONE = 10
LEVEL_TWO = 20
LOW_COMMISSION = 10
MIDDLE_COMMISSION = 20
HIGH_COMMISSION = 40

def main():

    sold = int(input("How many computers did you sell this month?\n"))
    bonus = 0
    
    # Low level bonus.
    if sold <= LEVEL_ONE:
        bonus = sold*LOW_COMMISSION

    # Middle bonus.
    elif sold <= LEVEL_TWO:
        bonus = LEVEL_ONE*LOW_COMMISSION + (sold - LEVEL_ONE)*MIDDLE_COMMISSION

    # All three levels of bonus.
    else:

        # First add it low and middle level.
        bonus = LEVEL_ONE*LOW_COMMISSION + (LEVEL_TWO - LEVEL_ONE)*MIDDLE_COMMISSION;

        # Add in the high level here.
        bonus = bonus + (sold - LEVEL_TWO)*HIGH_COMMISSION;
    

    # Print out the result.
    print("You earned $", bonus," this month in bonuses.", sep="")


main()
