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

black = S.count('#')
here = 0
if S[0] == '.':
    for i in range(N - 1):
        if S[i] == '.' and S[i + 1] == '#':
            here = i + 1

print(min(black, N - black, S[here:].count('.')))