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

if '#' not in S or '.' not in S:
    print(0)
else:
    ans = []
    for i in range(N):
        if S[i] == '#':
            ans.append(S[:i].count('#') + S[i:].count('.'))
    else:
        print(min(ans))