#yuki1893 x,y=map(int,input().split()) res=(max(x,y)+4)%12 print(res)