def main(): S = input() T = S.split('11') T.pop(0) ans = 0 cnt = 0 for t in reversed(T): cnt += t.count('0') ans += cnt print(ans) main()