H = input().strip() count = 0 n = len(H) for i in range(n - 1): if H[i] == '(' and H[i+1] == ')': count += 1 print(0 if count % 2 else 1)