a,b=map(int,input().split()) print(4 if a+b==5 else a+b)