m,d=map(int,input().split()) print(""if m==4and d==1else m+d)