n=int(input())
s=input()

for i in range(len(s)):

    if '#' not in s:
        print('0')
        break
        
    elif s[i]=='#':
        if s[len(s)-1]=='#':
            print(min(s[i:].count('.'),s[i:].count('#')-1))
            break
        else:
            print(min(s[i:].count('.'),s[i:].count('#')))
            break