N = int(input())
S = input()


def m():
    ans = 0
    left, right = 0, N
    for i in range(N):
        if S[i] == '#':
            left = i
            break
    for i in reversed(range(N)):
        if S[i] == '.':
            right = i
            break
    tmp = S[left:right+1]
    black = tmp.count('#')
    white = tmp.count('.')
    ans = min(black,white)
    return ans

print(m())