s,v=map(int,input().split(" "))
t=s/v+10
x=480-t #总时间减用掉的
h=int(x//60)
m=int(x % 60)
print(f'{h:02d}{":"}{m:02d}')