while True:
try:
x = int(input().strip('\r'))
if x>=15:
print(x-15)
else:
print(x+24-15)
except EOFError:
break