x,y = map(int,input().split()) print((y+(y-x))%12)