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

w = S.count('.')
b = S.count('#')

if w == 0 or b == 0:
    print(0)
    exit()

ans = 10 ** 6
nw = w
nb = 0
for i in range(N):
    if S[i] == '.':
        nw -= 1
    else:
        nb += 1
    ans = min(ans, nb + nw)

print(ans)
