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

num = 0
result = 0

for i in range(N-1,-1,-1):
    if S[i] == "." :
        #print(i)
        num = i+1
        break

white = S[0:num].count('.')
black = S[0:num].count('#')
if white < black:
    result = white
else:
    result = black
print(result)