S = input() i = 0 o = 0 ans = 0 while i < len(S): if S[i] == "0": ans += o else: if S[min(len(S)-1, i+1)] == "1": o += 1 i += 1 i += 1 print(ans)