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

b = S.count('#')
w = N - b
b_loc = 10**6
for i in range(N):
    if S[i] == '#':
        b_loc = i
        break
if b_loc ==10**6:
    ans = 0
else:
    ans = min(b, N - b - b_loc )
print(ans)