T,S,D=map(int, input().split()) t=D/S now=T ans=0 for i in range(10000): if 18<=now<24 or now<6: tt=min(1,t) t-=tt ans+=tt else: tt=min(1,t) t-=tt now+=1 now%=24 if t==0: print(ans) exit()