import sys
if __name__ == "__main__":
    N = int(input())
    S = input()

    kuro = S.find("#")
    shiro = S.find(".")
    S_list = list(S)
    if kuro==-1 or shiro==-1:
        print(0)
    
    elif shiro<kuro:
        shikiri=kuro
        while(True):
            if S[shikiri] =="#":
                shikiri += 1
            else:
                break
        match=S[(shikiri):]
        print(min((shikiri-kuro),match.count(".")))
    
    else:
        print(min(S.count("."),S.count("#")))