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

for i in range(N+1):
    T = ["."]*i + ["#"]*(N-i)
    cnt = 0
    for j in range(N):
        if S[j] != T[j]:
            cnt += 1
    ans = min(cnt,ans)

print(cnt)