#1,3,5,7, a = [ [ 2*(i*4 +j +1)-1 for j in range(4)] for i in range(3)] #用到了数学抽象 abstract i,j = map(int,input().split()) print( a[i][j])