def bouquets(narcissus_price, tulip_price, rose_price, summ):
n=int(summ//narcissus_price)
k=int(summ//tulip_price)
p=int(summ//rose_price)
count=0
for i1 in range(0,n+1):
for i2 in range(0,k+1):
for i3 in range(0, p+1):
if (i1+i2+i3)%2 != 0:
if i1*narcissus_price+i2*tulip_price+i3*rose_price<=summ:
count+=1
else:
break
return count
print( bouquets(200,300,400,100000) )
ZGVmIGJvdXF1ZXRzKG5hcmNpc3N1c19wcmljZSwgdHVsaXBfcHJpY2UsIHJvc2VfcHJpY2UsIHN1bW0pOgogICAgbj1pbnQoc3VtbS8vbmFyY2lzc3VzX3ByaWNlKQogICAgaz1pbnQoc3VtbS8vdHVsaXBfcHJpY2UpCiAgICBwPWludChzdW1tLy9yb3NlX3ByaWNlKQogICAgY291bnQ9MAogICAgZm9yIGkxIGluIHJhbmdlKDAsbisxKToKICAgICAgICBmb3IgaTIgaW4gcmFuZ2UoMCxrKzEpOgogICAgICAgICAgICBmb3IgaTMgaW4gcmFuZ2UoMCwgcCsxKToKICAgICAgICAgICAgCWlmIChpMStpMitpMyklMiAhPSAwOgogICAgICAgICAgICAgICAgICAgIGlmIGkxKm5hcmNpc3N1c19wcmljZStpMip0dWxpcF9wcmljZStpMypyb3NlX3ByaWNlPD1zdW1tOgogICAgICAgICAgICAgICAgICAgICAgICBjb3VudCs9MQogICAgICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgCWJyZWFrCiAgICByZXR1cm4gY291bnQKICAgIApwcmludCggYm91cXVldHMoMjAwLDMwMCw0MDAsMTAwMDAwKSAp