N=int(input())
S=input()
c=0
d=0
switch=0
for i in range(N):
    if S[i]=='#' and switch==0:
        switch=1
    elif switch==1 and S[i]=='.':
        c=S[i-1:].count('.')
        break
S=S[::-1]
for i in range(N):
    if S[i]=='.' and switch==0:
        switch=1
    elif switch==1 and S[i]=='#':
        d=S[i-1:].count('#')
        break
print(min(c,d))