N = int(input())
S = input()
 
ans=N
left_black=0
right_white=S.count(".")

for i in S:
    if i==".":
        right_white-=1
        ans=min(ans,left_black+right_white)
    else:
        left_black+=1
        ans=min(ans,left_black+right_white)
print(ans)    