#37759: python注意括號


s110229@student.cysh.cy.edu.tw (許鈞閎)


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