H = input().strip() count = 0 depth = 0 for c in H: if c == '(': if depth == 0: count += 1 depth += 1 else: depth -= 1 if count % 2 == 0: print(1) else: print(0)