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([len(S)+1,w,b])
for i in range(len(S)-1):
    if(S[i]=="#"):
        b_ += 1
    #if(S[i]=="#" and S[i+1]=="."):
    w_ = w-(i+1-b_)
    min_ = min([w_+b_,min_])
    #print(i,w_+b_)
        
    
    
print(min_)