N = int(input())
S = input()

for i in range(N):
    if S[i]=='#':
        break
B = S[i:].count('#')
W = S[i:].count('.')
if B<W:
    ans = B
    if S[-1]=="#":
        ans -= 1
else:
    ans = W
print(ans)
