#C
N=int(input())
S=input()
even = "#"*N
odd = "."*N
eve_c=N-S.count('#')
odd_c=N-S.count('.')
ans=[]
for i in range(N):
    ans.append(S[:i+1].count('#')+S[i+1:].count('.'))

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