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

all_Black = S.count('.')
all_White = S.count('#')
White_Black = 1000000
if S[0] == '.':
    for i in range(len(S)-1):
        if S[i] == '.' and S[i+1] == '#':
            S.pop(0)
            break
    White_Black = S.count('.')
print(min(all_Black,all_White,White_Black))
