B. Valentine's Restaurant
time limit per test
1 second
memory limit per test
64 megabytes
input
stdin
output
stdout

Peyman wants to take his love, Kimia to a modern restaurant, MaInHameRahUmadim on Valentine's day. The are n tables there. Each table has some subtables. Their graph forms a rooted forest (each component forms a rooted tree). Kimia just wondered, what's the number of connected components in this graph ? Peyman is lazy and also he wants everything to be perfect. So he asked you to answer him.

As you know, we can show a rooted forest with a proper sequence of [ and ]. Here, each vertex has an interval (a [ and its match) and a vertex is an ancestor of another vertex, if the other vertex's interval is inside it's interval.

You are given this forest as a string with [ and ] . You should write a program using Prolan language that it's input is the forest, and it's output is the number of components (an integers), without leading zero .

Your program's order mustn't exceed 107 .

Input

A proper sequence of [ and ], s .

1 ≤ |s| ≤ 1000

Output

An integer.

Examples
Input
[][[[]][][][][[]]][]
Output
3
Input
[[]][][[[[[]]]]][[][][]][[][][]]
Output
5
Input
[]
Output
1