N  = int(input())
S = input()
black = S.count("#")
white = N - black
ans = min(black , white)
if black == 0 or white == 0:
    print(0)
else:
    temp = 0
    for i in range(N-1):
        if S[i] == '#':
            black -= 1
            white += 1
            temp += 1
            ans = min(ans, temp + black , temp + white) 
    print(ans)
