#include<stdlib.h>
#include<iostream>
using namespace std;
typedef struct BiTNode{
char data;
struct BiTNode *lchild,*rchild;
} BiTNode,*BiTree;
void CreateBiTree(BiTree &T){
char ch;
cin>>ch;
if(ch=='*') T=NULL;
else
{
T=(BiTNode *)malloc(sizeof(BiTNode));
T->data=ch;
CreateBiTree(T->lchild);
CreateBiTree(T->rchild);
}
}
int max(int a,int b)
{
if(a>b)
return a;
else
return b;
}
int maxdepth(BiTree T)
{
if(T==NULL)
return 0;
else
{
int lchild =maxdepth(T->lchild);
int rchild =maxdepth(T->rchild);
return max(lchild,rchild)+1;
}
}
int main(){
BiTree T;
CreateBiTree(T);
cout<<maxdepth(T);
system("pause");
return 0;
}