m = int(eval(input()))

print((48 - m))
def main():

    M = int(eval(input()))

    print((24 - M + 24))





if __name__ == '__main__':

    main()

m = int(eval(input()))
print((48 - m))

def main():
    M = int(eval(input()))
    print((24 - M + 24))


if __name__ == "__main__":
    main()

-m = int(eval(input())) -print((48 - m)) +def main(): +    M = int(eval(input())) +    print((24 - M + 24)) + + +if __name__ == "__main__": +    main()