Ordinal Number
time limit per test
2 seconds
memory limit per test
512 mebibytes
input
standard input
output
standard output

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$$$.

Input

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.

Output

Print the integer $$$n$$$ corresponding to the given ordinal number.

Examples

Input
{}
Output
0
Input
{{}}
Output
1
Input
{{},{{}}}
Output
2
Input
{{{}},{{{}},{}},{}}
Output
3