#34999: python 一行解


1554101-0@g.puiching.edu.mo (P6A29_1300題了)


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