k=0
n=0
while k<6:
n=n+1
w=0
for a in range(0,n/6+1):
for b in range(0,n/9+1):
for c in range(0,n/20+1):
if 6*a+9*b+20*c == n:
w=1
if w==1:
k=k+1
else:
k=0
wanted=n
print 'the largest number of McNuggets\
that cannot be bought in exact quantity:',wanted