✅ 정답 공개
heights = list(map(int, input().split()))
heights.append(0)
stack = []
max_area = 0
for i, h in enumerate(heights):
while stack and heights[stack[-1]] > h:
top = stack.pop()
width = i if not stack else i - stack[-1] - 1
max_area = max(max_area, heights[top] * width)
stack.append(i)
print(max_area)