#C
N=int(input())
S=input()
even = "#"*N

odd = "."*N
eve_c=0
odd_c=0
ans=[]
for i in range(N):
    ans.append(S[0:i+1].count('#')+S[i+1:].count('.'))
    if S[i]!=even[i]:
        eve_c+=1

    if S[i]!=odd[i]:
        odd_c+=1

ans.append(eve_c)
ans.append(odd_c)
print(min(ans))