N = int(input())
S = input()
white = (S)
white = S.count('.')
black = S.count('#')
for i in range(0,N):
    if S[i] == '.':
        last_white = i+1
l_w = last_white - white
if l_w <= white and l_w <= black:
    print(l_w)
elif white <= l_w and white <= black:
    print(white)
elif black <= l_w and black <= white:
    print(black)
