from itertools import groupby mod = 924844033 s = input() n = len(s) if all(s[i]=="0" for i in range(n)): exit(print(n)) data = [] val = s[0] cnt = 1 for i in range(1,n): if s[i]==val: cnt += 1 else: data.append((val,cnt)) val = s[i] cnt = 1 data.append((val,cnt)) Start = 1 End = 1 if data[0][0]=="0": Start+=data[0][1] data=data[1:] if data[-1][0]=="0": End+=data[-1][1] data.pop() n = len(data) if n==1: print(data[0][1]*Start*End) exit() stack = [] dp = data[0][1] pre = 0 for i in range(2,n,2): j = -1 while stack and data[stack[-1][0]][1]