money = 100000 b = 0 while money>0: if money>50000: money -= money*0.05 else: money -= 5000 if money>=0: b=b+1 print(b)