S=list(input())

b = 0
w = 0
for i in range(len(S)):
    if(S[i]=="#"):
        b += 1
    else:
        w += 1
        
b_ = 0
min_ = min([w,b])
w_ = 0
for i in range(len(S)):
    if(S[i]=="#"):
        b_ += 1
    else:
        w_ += 1
    min_ = min([w-w_+b_,min_])
        

print(min_)