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

idx = s.find('#')
if idx < 0:
    print(0)
    exit()
    
ans1 = s[idx:].count('.')

s = s[::-1]
idx = s.find('.')
if idx < 0:
    print(0)
    exit()

ans2 = s[idx:].count('#')

print(min(ans1, ans2))