N = int(input())
S = 'a'+input()+'a'
ans = 10**9
key = 'b'

for i in range(1,N+2):
    if key != S[i]:
        ans = min(ans,S[:i].count('#')+S[i:].count('.'))
        key = S[i]
        print(S[:i].count('#'),S[i:].count('.'))
print(ans)