# your code goes here
import math

def bouquets(narcissus_price, tulip_price, rose_price, summ):
    prices = sorted( [ narcissus_price, tulip_price, rose_price ], reverse = True )
    counter = 0
    for i in range( math.floor( summ / prices[0] ) + 1 ):
        for j in range( math.floor( ( summ - i * prices[0] ) / prices[1] ) + 1):
            counter += math.floor( ( summ - i * prices[0] - j * prices[1] ) / prices[2] ) + 1
                    
    return counter
    
print( bouquets(1,1,1,2) )
