a[9];main(x){for(;x=~getchar()%69;a[x&8]+=x/12*2+1);x=!printf("%f",sqrt(--*a**a+a[8]*a[8]));}