import sys

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

left = 0

for i in range(N):
    if(S[i] == '#'):
        T = S[i:]
        left = T.count('.')
        break

right = 0

for i in range(N):
    j = (N-1)-i
    if(S[j] == '.'):
        T = S[:j+1]
        right = T.count('#')
        break

print(min(left,right))