Поляков 14 — 239 n=(729**41 - 81**16)*(729**15 + 9**5) k=0 while n>0: ost=n%9 n=n//9 if ost==8: k+=1 print(k)