import collections

def solve():
    N=int(input())
    S=list(input())
    left=0
    right=N-1
    for i,c in enumerate(S):
        if c=='.':
            continue
        left=i
        break
    else:
        left=N
    for i in range(N-1,-1,-1):
        if S[i]=='#':
            continue
        right=i
        break
    else:
        right=-1
    #print(left,right)
    if left>right:
        return 0
    S=S[left:right+1]
    cnt=collections.Counter(S)
    #print(cnt)
    if cnt['.']>cnt['#']:
        return cnt['#']
    else:
        return cnt['.']

print(solve())
