# 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) )
IyB5b3VyIGNvZGUgZ29lcyBoZXJlCmltcG9ydCBtYXRoCgpkZWYgYm91cXVldHMobmFyY2lzc3VzX3ByaWNlLCB0dWxpcF9wcmljZSwgcm9zZV9wcmljZSwgc3VtbSk6CiAgICBwcmljZXMgPSBzb3J0ZWQoIFsgbmFyY2lzc3VzX3ByaWNlLCB0dWxpcF9wcmljZSwgcm9zZV9wcmljZSBdLCByZXZlcnNlID0gVHJ1ZSApCiAgICBjb3VudGVyID0gMAogICAgZm9yIGkgaW4gcmFuZ2UoIG1hdGguZmxvb3IoIHN1bW0gLyBwcmljZXNbMF0gKSArIDEgKToKICAgICAgICBmb3IgaiBpbiByYW5nZSggbWF0aC5mbG9vciggKCBzdW1tIC0gaSAqIHByaWNlc1swXSApIC8gcHJpY2VzWzFdICkgKyAxKToKICAgICAgICAgICAgY291bnRlciArPSBtYXRoLmZsb29yKCAoIHN1bW0gLSBpICogcHJpY2VzWzBdIC0gaiAqIHByaWNlc1sxXSApIC8gcHJpY2VzWzJdICkgKyAxCiAgICAgICAgICAgICAgICAgICAgCiAgICByZXR1cm4gY291bnRlcgogICAgCnByaW50KCBib3VxdWV0cygxLDEsMSwyKSApCg==