N = int(input())
S = input()
min_ans = 2*10**5
ideal1 = "."*N
ideal2 = "."*(N-1) + "#"
ideal3 = "#"*N
ideal4 = "." + "*"*N
ideals = [ideal1,ideal2,ideal3,ideal4]
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)