from __future__ import print_function
import sys

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


n=int(input())
S=list(input())

cnt_temp=0
stack=[]
cnt=0

# eprint(n)
# eprint(S)

# for i in range(n):
#     eprint(i)

    
for i in range(n):
    if S[i] == '.':
        cnt_temp+=1

for i in range(n-1):
    if S[i]=='#' and S[i+1]=='#':
        stack.append(i)
    elif S[i]=='#' and S[i+1]=='.':
        
        S[i]='.'
        cnt+=1
        while stack!=[]:
            temp=stack.pop()
            S[temp]='.'
            cnt+=1
        

print(min(cnt,cnt_temp))
            #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
