a=int(input())
h=(10+a//100)%24
m=a%100/100*60;m=int(m)
if m<10: m='0'+str(m)
print(h,':',m,sep='')