#55466: python 一行解


gdd0408 (Comma)


print((25-int(input())+60)%60)