Time limit
2s
Memory limit
128 MB
A compressed string S is given. In the original uncompressed string, some substring may be written in the form K(Q). K is a one-digit integer, and Q is a string of length 0 or more. K(Q) means that the string Q is repeated K times. Given the compressed string S, compute the length of the string after it is fully decompressed.
The first line contains the compressed string S. The length of S is at most 50. S consists only of (, ), and digits from 0 to 9.
Print the length of the fully decompressed string on the first line. This value is at most 2,147,473,647.