N = int(input())
S = input()
i = 0
for i in range(N):
    i += 1
    if S[i - 1] == '#':
        break

T = S[i - 1:]

B = T.count('#')
W = T.count('.')

if  S[i - 1] == '#' and B <= W:
    print(min(B, W) - 1)
else:
    print(min(B, W))