N = int(input())
S = input()
white = (S)
white = S.count('.')
black = S.count('#')
for i in range(0,N):
    if S[i] = '.':
        last_white = S[i]
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)
