S = input() S = S.replace("11","2") ans = 0 zero = 0 for i in S[::-1]: if(i == "0"): zero += 1 elif(i == "2"): ans += zero print(ans)