r,d=map(int,input().split()) if 2*r==d or r==d: print(4) elif 2*r