from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline D1,D2 = map(int,input().split()) D1 *= 2 if D1==D2: print(4) elif D1