题解 | #汽水瓶#
汽水瓶
http://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
while True:
n = int(input().strip())
if n == 0:
break
num = 0
count = n//3 + n % 3
num = n//3
while count >= 3:
num += count//3
count = count//3 + count % 3
if count == 2:
num += 1
print(num)