Ordinal numbers are an extension of the set of nonnegative integers. For each nonnegative integer $$$x$$$, we will establish the corresponding ordinal number $$$f (x)$$$. The first few ordinal numbers can be defined as follows.
Next, we can similarly define ordinal numbers that don't correspond to integers. Alas, we won't need them in this problem.
You are given a string describing an ordinal number corresponding to a nonnegative integer $$$n$$$. Find $$$n$$$.
The first line contains the description of an ordinal number corresponding to a certain nonnegative integer $$$n$$$ ($$$0 \le n \le 15$$$). It consists of the characters "{", ",", and "}".
In the description of each set, each element appears exactly once. However, as a set does not change if we change the order of elements, this order can be arbitrary.
Print the integer $$$n$$$ corresponding to the given ordinal number.
{}
0
{{}}
1
{{},{{}}}
2
{{{}},{{{}},{}},{}}
3