#C
N=int(input())
S=input()
even = "#"*N
odd  = "." +"#"*(N-1)
odd2 = "."*N
eve_c=0
odd_c=0
odd_2=0
for i in range(N):
    if S[i]!=even[i]:
        eve_c+=1

    if S[i]!=odd[i]:
        odd_c+=1

    if S[i]!=odd2[i]:
        odd_2+=1

print(min(eve_c,odd_c,odd_2))