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) comp = [data[i][1] for i in range(n)] if n==1: print(comp[0]*Start*End) exit() stack=[] dp = [0]*n dp[0] = comp[0] pre = [0]*n for i in range(2,n,2): j = -1 while stack and comp[stack[-1]]