Question and Answer from L4-M2
s=input().strip()
h=list(map(int,s[1:-1].split(','))) if s[0]=='[' else list(map(int,s.split()))
h+=[0]
st=[];r=0
for i,x in enumerate(h):
while st and h[st[-1]]>x:
H=h[st.pop()]
W=i if not st else i-st[-1]-1
r=max(r,H*W)
st.append(i)
print(r)