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