a,b,c=map(int,input().split()) d,e,f=map(int,input().split()) if a and b and c>d and e and f: print(1) else: print(2)