import sys


# \n
def input():
    return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    S=list(input())

    if S.count("#")==0:
        print(0)
        exit()
    a=S.index("#")

    white = S[a:].count(".")

    black = S.count("#")
    print(min(black,white))





if __name__ == "__main__":
    main()
