L,R=map(int,input().split()) if 1<=L<=295: if 1<=R<=295:print(0) elif 296<=R<=416:print(1) else:print(2) elif 296<=L<=416: if 296<=R<=416:print(0) else:print(1) else: print(0)