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

start_black = 0
for i in range(N):
    if S[i] == '#':
        start_black = i
        break

S = S[start_black:]

white = 0
black = 0
for i in range(len(S)):
    if S[i] == '#':
        black += 1
    else:
        white += 1

if black > white:
    print(white-1)
else:
    print(black)
