N = int(input())
S = input()
min_ans = 2*10**5

ideals = []
for i in range(N+1):
    ideals.append("."*i + "#"*(N-i))
for ideal in ideals:
    ans = 0
    for i in range(N):
        if S[i] != ideal[i]:
            ans += 1
    if ans < min_ans:
        min_ans = ans
print(min_ans)
            