How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December?
# -*- coding: utf-8 -*-

a=input()
a=int(a)
b=24-a
print(b)
# -*- coding: utf-8 -*-

a=input()
a=int(a)
b=24+(24-a)
print(b)