N = int(input())
S = input()
start = S.find("#")
if start == -1:
    print("0")
else:
    di = {".":"0","#":"1"}
    S_bin = int("0b"+S[start:].translate(str.maketrans(di)), 0)
    a = int("0b"+"1"*int(N-start) ,0)
    ans1 = bin(a^S_bin).count("1")
    ans4 = bin(int("0b"+"0"*int(N-start) ,0)^S_bin).count("1")
    ans2 = bin(0^int("0b"+S.translate(str.maketrans(di)), 0)).count("1")
    ans3 = bin((int("0b"+"1"*int(N) ,0))^int("0b"+S.translate(str.maketrans(di)), 0)).count("1")
    print(min(ans1,ans2,ans3,ans4))