#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 100
int a[MAXSIZE];
typedef struct TNode
{
char data;
struct TNode* lchild;
struct TNode* rchild;
}TNode;
TNode* creat()
{
char x;
TNode* pT;
scanf("%c", &x);
if (x == '#')
pT = NULL;
else
{
pT = (TNode*)malloc(sizeof(TNode));
pT->data = x;
pT->lchild = creat();
pT->rchild = creat();
}
return pT;
}
void width(TNode* pT, int i)
{
if (pT == NULL)
return;
else
{
a[i]++;
width(pT->lchild, i + 1);
width(pT->rchild, i + 1);
}
}
int main()
{
int w = 0, i = 0;
TNode* pT;
pT = creat();
width(pT, 1);
for (i = 0; i < MAXSIZE; i++)
{
if (a[i] > w)
w = a[i];
}
printf("%d", w);
return 0;
}