'''
a = input()
if a == 1:
    print 'One!'
elif a ==2:
    print 'two!'
elif a ==3:
    print 'Three!'
else:
    print 'Too many!'
'''

x=input()
y=input()

if x >= 0:
    if y >=0:
        print 1
    else:
        print 4
else:
    if y >=0:
        print 2
    else:
        print 3
        
