n = int(input())
s = list(input())
if ('#' not in s) or ('.' not in s):
    print('0')
else:
    black1 = s.count('#')
    white1 = s.count('.')
    for i in reversed(s):
        if i == '#':
            n -= 1
        else:
            break
    a = s.index('#')
    s1 = s[a:]
    if '.' in s1:
        white2 = s1.count('.')
        s2 = s1[:n]
        if '#' in s2:
            black2 = s2.count('#')
            print(min(white1,white2,black1,black2))
        else:
            print(min(white1,white2,black1))
    else:
        print(min(black1,white1))