N = int(input())
S = str(input())
 
 
S2 = ''.join(S.split("#")[1:])
S3 = ''.join(S.split(".")[:-1])
if S2 == S:
        print("0")
else:
    sn = S2.count(".")
    sn3 = S3.count("#")
    co = N
    for i in range (N):
        tco = S[:N].count("#") + S[N:].count(".")
        if co > tco:
            co = tco
    print(min(co,sn,sn3))