n = int(input())
s = list(input())
black1 = s.count('#')
white1 = s.count('.')
if black1 > 0:
    for i in reversed(s):
        if i == '#':
            n -= 1
        else:
            break
    l1 = s[:n]
    black2 = l1.count('#')
    b = l1.index('#')
    l2 = l1[b:]
    white2 = l2.count('.')
    l3 = s[b:]
    black3=l3.count('#')
    print(min(black1,white1,black2,white2,black3))
else:
    print('0')