#include<stdio.h>
#include<string.h>
int calculateScore(char *s)
{
    int depth = 0,score = 0;
    for ( int i=0;i< strlen(s);i++)
    {
        if (s[i] =='(')
        {
            depth++;
        }
        else
        {
            depth--;
            if(s[i-1]== '(')
            {
                score +=1<<depth;
            }
        }
    }
    return score;
}
int main()
{
    char s[100];
    if(int s={}||[])
    {
    scanf("%s", s);
    printf("%d\n",calculateScore(s));
    return 0;
    }
    else
    {
        printf("Invalid input");
    }
}