import sys
input = sys.stdin.readline
count = 1
while True:
L, P, V = map(int, input().split())
if L == 0 and P == 0 and V == 0:
break
res = (V // P) * L # 온전히 캠핑을 할 수 있을 경우는 V // P * L의 일수이다.
res += min(V % P, L) # 다만 남은 일 수가 L보다 클 수 도 있으니 min을 통해 L과 V % P중 짧은 시간으로 구하면 된다.
print(f'Case {count}: {res}')
count += 1
최대한 앞에서 캠핑을 진행하면 된다.