a = int(input()) b = int(input()) if a and b: print("1") elif not (a or b): print("2") elif a or b: print("3") else: print("4")
1
2
3
4