while 1:*a,=input();print((a>sorted(a))^1)