T,S,D = map(int, input().split()) ans = 0 while D>0: if 0<=T<6 or 18<=T<24: if D>=S: ans+=1 D-=S else: ans+=D/S D-=S else: D-=S T=(T+1)%24 print(ans)