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

for i in range(N):
    if S[i] == '#':
        first_black = i+1
        break
    first_black = i+1

cnt = 0
if first_black == N:
    pass
else:
    for i in range(first_black-1,N,1):
        if S[i] == '.':
            cnt += 1

if S[N-1] == '#':
    white = N-first_black-cnt
else:
    white = N-first_black-cnt+1
    
if white > cnt:
    print(cnt)
else:
    print(white)